pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

corefx-git: Feature detect ip_mreq and ip_mreqn



Module Name:	pkgsrc-wip
Committed By:	jasonwilliams200ok <necmon%yahoo.com@localhost>
Pushed By:	danglingpointer
Date:		Mon Feb 8 14:57:10 2016 +0000
Changeset:	ebaaaf8952f4b9b3d3a7fe0fb776cf2589bd7ed3

Modified Files:
	corefx-git/distinfo
	corefx-git/patches/patch-src_Native_Common_pal__config.h.in
	corefx-git/patches/patch-src_Native_System.Native_pal__networking.cpp
	corefx-git/patches/patch-src_Native_configure.cmake

Log Message:
corefx-git: Feature detect ip_mreq and ip_mreqn

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=ebaaaf8952f4b9b3d3a7fe0fb776cf2589bd7ed3

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 corefx-git/distinfo                                |  6 ++--
 .../patch-src_Native_Common_pal__config.h.in       |  9 +++++
 ...ch-src_Native_System.Native_pal__networking.cpp | 40 ++++++++++++++++++++++
 .../patches/patch-src_Native_configure.cmake       | 21 +++++++++---
 4 files changed, 69 insertions(+), 7 deletions(-)

diffs:
diff --git a/corefx-git/distinfo b/corefx-git/distinfo
index 3309097..89b61e5 100644
--- a/corefx-git/distinfo
+++ b/corefx-git/distinfo
@@ -1,8 +1,8 @@
 $NetBSD$
-SHA1 (patch-src_Native_Common_pal__config.h.in) = 1407a3654fd01308535ca9241152e7c26397cc22
+SHA1 (patch-src_Native_Common_pal__config.h.in) = 31f32366dc9dbfadd6c559727cbbb972c1f7531c
 SHA1 (patch-src_Native_System.Native_pal__errno.cpp) = 80c19049b465824ebd518c367e228231f12b5022
 SHA1 (patch-src_Native_System.Native_pal__interfaceaddresses.cpp) = 4f82e6f028fe2b9826ba6afb62869e42a0b6ee3d
 SHA1 (patch-src_Native_System.Native_pal__mount.cpp) = 7858f5ff60fcb0d60452648aef1b1034698e2c85
-SHA1 (patch-src_Native_System.Native_pal__networking.cpp) = 4f9b7c92c601ff7bbeb85fd6468720ade5d9a939
-SHA1 (patch-src_Native_configure.cmake) = f61be5cf28e954a0ed3cbaddddfb1d40c852b1c8
+SHA1 (patch-src_Native_System.Native_pal__networking.cpp) = 28eab23c604c3cd7e3488617f60c9d0cf39ca682
+SHA1 (patch-src_Native_configure.cmake) = d5b93aa7fdd07fc1da54004ce984366e0799a952
 SHA1 (patch-src_Native_gen-buildsys-clang.sh) = efc34b0da3d11b1c66625336bb4d3c7ac5273b60
diff --git a/corefx-git/patches/patch-src_Native_Common_pal__config.h.in b/corefx-git/patches/patch-src_Native_Common_pal__config.h.in
index 928365a..3130e58 100644
--- a/corefx-git/patches/patch-src_Native_Common_pal__config.h.in
+++ b/corefx-git/patches/patch-src_Native_Common_pal__config.h.in
@@ -29,3 +29,12 @@ $NetBSD$
  #cmakedefine01 HAVE_GETHOSTBYNAME_R
  #cmakedefine01 HAVE_GETHOSTBYADDR_R
  #cmakedefine01 HAVE_SUPPORT_FOR_MULTIPLE_CONNECT_ATTEMPTS
+@@ -33,6 +39,8 @@
+ #cmakedefine01 HAVE_ICANON
+ #cmakedefine01 HAVE_TCSANOW
+ #cmakedefine01 HAVE_IN_PKTINFO
++#cmakedefine01 HAVE_IP_MREQ
++#cmakedefine01 HAVE_IP_MREQN
+ #cmakedefine01 HAVE_TCP_VAR_H
+ #cmakedefine01 HAVE_RT_MSGHDR
+ #cmakedefine01 HAVE_LINUX_RTNETLINK_H
diff --git a/corefx-git/patches/patch-src_Native_System.Native_pal__networking.cpp b/corefx-git/patches/patch-src_Native_System.Native_pal__networking.cpp
index f080418..3fcd97a 100644
--- a/corefx-git/patches/patch-src_Native_System.Native_pal__networking.cpp
+++ b/corefx-git/patches/patch-src_Native_System.Native_pal__networking.cpp
@@ -178,3 +178,43 @@ $NetBSD$
  
  extern "C" int32_t SystemNative_GetHostByAddress(const IPAddress* address, HostEntry* entry)
  {
+@@ -1188,7 +1319,11 @@ extern "C" Error SystemNative_GetIPv4Mul
+         return PAL_EINVAL;
+     }
+ 
++#if HAVE_IP_MREQ
++    ip_mreq opt;
++#elif HAVE_IP_MREQN
+     ip_mreqn opt;
++#endif
+     socklen_t len = sizeof(opt);
+     int err = getsockopt(socket, IPPROTO_IP, optionName, &opt, &len);
+     if (err != 0)
+@@ -1197,8 +1332,12 @@ extern "C" Error SystemNative_GetIPv4Mul
+     }
+ 
+     *option = {.MulticastAddress = opt.imr_multiaddr.s_addr,
++#if HAVE_IP_MREQ
++               .LocalAddress = opt.imr_interface.s_addr};
++#elif HAVE_IP_MREQN
+                .LocalAddress = opt.imr_address.s_addr,
+                .InterfaceIndex = opt.imr_ifindex};
++#endif
+     return PAL_SUCCESS;
+ }
+ 
+@@ -1215,9 +1354,14 @@ extern "C" Error SystemNative_SetIPv4Mul
+         return PAL_EINVAL;
+     }
+ 
++#if HAVE_IP_MREQ
++    ip_mreq opt = {.imr_multiaddr = {.s_addr = option->MulticastAddress},
++                   .imr_interface = {.s_addr = option->LocalAddress}};
++#elif HAVE_IP_MREQN
+     ip_mreqn opt = {.imr_multiaddr = {.s_addr = option->MulticastAddress},
+                     .imr_address = {.s_addr = option->LocalAddress},
+                     .imr_ifindex = option->InterfaceIndex};
++#endif
+     int err = setsockopt(socket, IPPROTO_IP, optionName, &opt, sizeof(opt));
+     return err == 0 ? PAL_SUCCESS : SystemNative_ConvertErrorPlatformToPal(errno);
+ }
diff --git a/corefx-git/patches/patch-src_Native_configure.cmake b/corefx-git/patches/patch-src_Native_configure.cmake
index 626b552..3fb8833 100644
--- a/corefx-git/patches/patch-src_Native_configure.cmake
+++ b/corefx-git/patches/patch-src_Native_configure.cmake
@@ -10,7 +10,20 @@ $NetBSD$
  
  # in_pktinfo: Find whether this struct exists
  check_include_files(
-@@ -34,6 +35,10 @@ check_include_files(
+@@ -27,6 +28,12 @@ check_type_size(
+     "struct in_pktinfo"
+     HAVE_IN_PKTINFO
+     BUILTIN_TYPES_ONLY)
++check_type_size(
++    "struct ip_mreqn"
++    HAVE_IP_MREQN)
++check_type_size(
++    "struct ip_mreq" 
++    HAVE_IP_MREQ)
+ set(CMAKE_EXTRA_INCLUDE_FILES) # reset CMAKE_EXTRA_INCLUDE_FILES
+ # /in_pktinfo
+ 
+@@ -34,6 +41,10 @@ check_include_files(
      alloca.h
      HAVE_ALLOCA_H)
  
@@ -21,7 +34,7 @@ $NetBSD$
  check_function_exists(
      stat64
      HAVE_STAT64)
-@@ -75,6 +80,16 @@ check_symbol_exists(
+@@ -75,6 +86,16 @@ check_symbol_exists(
      "sys/ioctl.h"
      HAVE_TIOCGWINSZ)
  
@@ -38,7 +51,7 @@ $NetBSD$
  check_function_exists(
      tcgetattr
      HAVE_TCGETATTR)
-@@ -117,6 +132,22 @@ check_struct_has_member(
+@@ -117,6 +138,22 @@ check_struct_has_member(
      HAVE_STATFS_FSTYPENAME)
  
  check_struct_has_member(
@@ -61,7 +74,7 @@ $NetBSD$
      "struct in6_addr"
      __in6_u
      "netdb.h"
-@@ -157,6 +188,18 @@ check_function_exists(
+@@ -157,6 +194,18 @@ check_function_exists(
      gethostbyaddr_r
      HAVE_GETHOSTBYADDR_R)
  


Home | Main Index | Thread Index | Old Index