openbsd-ports/devel/ptlib/patches/patch-src_ptlib_unix_socket_cxx
ajacoutot a730dfbf59 Major update to ptlib-2.10.3.
Some clue from espie@

Needed to work on an Ekiga update.
There are still some rought edges but they'll be worked in-tree.

This and the upcoming VoIP ports commits wouldn't have been possible
without Miod's soft couch ;-)
2011-10-26 16:59:09 +00:00

112 lines
3.7 KiB
Plaintext

$OpenBSD: patch-src_ptlib_unix_socket_cxx,v 1.2 2011/10/26 16:59:09 ajacoutot Exp $
--- src/ptlib/unix/socket.cxx.orig Fri Oct 14 08:54:51 2011
+++ src/ptlib/unix/socket.cxx Sat Oct 22 12:41:24 2011
@@ -69,7 +69,7 @@
#include <netinet/if_ether.h>
#endif
-#if defined(P_NETBSD)
+#if defined(P_NETBSD) || defined(P_OPENBSD)
#include <ifaddrs.h>
#endif
@@ -484,9 +484,11 @@ PBoolean PIPSocket::IsLocalHost(const PString & hostna
PUDPSocket sock;
PBYTEArray buffer;
+#if !defined(P_NETBSD) && !defined(P_OPENBSD)
struct ifconf ifConf;
+#endif
-#if defined(P_NETBSD)
+#if defined(P_NETBSD) || defined(P_OPENBSD)
struct ifaddrs *ifap, *ifa;
PAssert(getifaddrs(&ifap) == 0, "getifaddrs failed");
@@ -509,7 +511,7 @@ PBoolean PIPSocket::IsLocalHost(const PString & hostna
while (ifName < ifEndList) {
#endif
struct ifreq ifReq;
-#if !defined(P_NETBSD)
+#if !defined(P_NETBSD) && !defined(P_OPENBSD)
memcpy(&ifReq, ifName, sizeof(ifreq));
#else
memset(&ifReq, 0, sizeof(ifReq));
@@ -526,14 +528,14 @@ PBoolean PIPSocket::IsLocalHost(const PString & hostna
}
}
-#if defined(P_FREEBSD) || defined(P_OPENBSD) || defined(P_MACOSX) || defined(P_VXWORKS) || defined(P_RTEMS) || defined(P_QNX)
+#if defined(P_FREEBSD) || defined(P_MACOSX) || defined(P_VXWORKS) || defined(P_RTEMS) || defined(P_QNX)
// move the ifName pointer along to the next ifreq entry
ifName = (struct ifreq *)((char *)ifName + _SIZEOF_ADDR_IFREQ(*ifName));
-#elif !defined(P_NETBSD)
+#elif !defined(P_NETBSD) && !defined(P_OPENBSD)
ifName++;
#endif
}
-#if !defined(P_NETBSD)
+#if !defined(P_NETBSD) && !defined(P_OPENBSD)
}
#endif
@@ -1875,9 +1877,11 @@ PBoolean PIPSocket::GetInterfaceTable(InterfaceTable &
PUDPSocket sock;
PBYTEArray buffer;
+#if !defined(P_NETBSD) && !defined(P_OPENBSD)
struct ifconf ifConf;
+#endif
-#if defined(P_NETBSD)
+#if defined(P_NETBSD) || defined(P_OPENBSD)
struct ifaddrs *ifap, *ifa;
PAssert(getifaddrs(&ifap) == 0, "getifaddrs failed");
@@ -1901,7 +1905,7 @@ PBoolean PIPSocket::GetInterfaceTable(InterfaceTable &
while (ifName < ifEndList) {
#endif
struct ifreq ifReq;
-#if !defined(P_NETBSD)
+#if !defined(P_NETBSD) && !defined(P_OPENBSD)
memcpy(&ifReq, ifName, sizeof(ifreq));
#else
memset(&ifReq, 0, sizeof(ifReq));
@@ -1920,7 +1924,7 @@ PBoolean PIPSocket::GetInterfaceTable(InterfaceTable &
macAddr = PEthSocket::Address((BYTE *)ifReq.ifr_macaddr);
#endif
-#if !defined(P_NETBSD)
+#if !defined(P_NETBSD) && !defined(P_OPENBSD)
memcpy(&ifReq, ifName, sizeof(ifreq));
#else
memset(&ifReq, 0, sizeof(ifReq));
@@ -1932,7 +1936,7 @@ PBoolean PIPSocket::GetInterfaceTable(InterfaceTable &
sockaddr_in * sin = (sockaddr_in *)&ifReq.ifr_addr;
PIPSocket::Address addr = sin->sin_addr;
-#if !defined(P_NETBSD)
+#if !defined(P_NETBSD) && !defined(P_OPENBSD)
memcpy(&ifReq, ifName, sizeof(ifreq));
#else
memset(&ifReq, 0, sizeof(ifReq));
@@ -1966,15 +1970,15 @@ PBoolean PIPSocket::GetInterfaceTable(InterfaceTable &
}
}
-#if defined(P_FREEBSD) || defined(P_OPENBSD) || defined(P_MACOSX) || defined(P_VXWORKS) || defined(P_RTEMS) || defined(P_QNX)
+#if defined(P_FREEBSD) || defined(P_MACOSX) || defined(P_VXWORKS) || defined(P_RTEMS) || defined(P_QNX)
// move the ifName pointer along to the next ifreq entry
ifName = (struct ifreq *)((char *)ifName + _SIZEOF_ADDR_IFREQ(*ifName));
-#elif !defined(P_NETBSD)
+#elif !defined(P_NETBSD) && !defined(P_OPENBSD)
ifName++;
#endif
}
-#if !defined(P_NETBSD)
+#if !defined(P_NETBSD) && !defined(P_OPENBSD)
}
#endif