summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorAndreas Schneider <asn@samba.org>2014-06-03 15:01:34 +0200
committerMichael Adam <obnox@samba.org>2014-06-05 23:57:10 +0200
commitaa1e24ead4712728cdc3bdd46c5171b1ac12bd23 (patch)
tree07efe7795d775a05203b40d033bd1a49810ae5f6 /lib
parent7556e1388f3eb84ea5c12940e578076b2438f78c (diff)
downloadsamba-aa1e24ead4712728cdc3bdd46c5171b1ac12bd23.tar.gz
samba-aa1e24ead4712728cdc3bdd46c5171b1ac12bd23.tar.xz
samba-aa1e24ead4712728cdc3bdd46c5171b1ac12bd23.zip
swrap: Check if the in_pktinfo structure is available.
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/socket_wrapper/socket_wrapper.c2
-rw-r--r--lib/socket_wrapper/wscript5
2 files changed, 6 insertions, 1 deletions
diff --git a/lib/socket_wrapper/socket_wrapper.c b/lib/socket_wrapper/socket_wrapper.c
index f5a7858d5c3..56d1d966a0a 100644
--- a/lib/socket_wrapper/socket_wrapper.c
+++ b/lib/socket_wrapper/socket_wrapper.c
@@ -3053,7 +3053,7 @@ static int swrap_msghdr_add_pktinfo(struct socket_info *si,
{
/* Add packet info */
switch (si->pktinfo) {
-#ifdef IP_PKTINFO
+#if defined(IP_PKTINFO) && defined(HAVE_STRUCT_IN_PKTINFO)
case AF_INET: {
struct sockaddr_in *sin;
struct in_pktinfo pkt;
diff --git a/lib/socket_wrapper/wscript b/lib/socket_wrapper/wscript
index 53dace41db6..60b4ca89d1c 100644
--- a/lib/socket_wrapper/wscript
+++ b/lib/socket_wrapper/wscript
@@ -48,6 +48,11 @@ def configure(conf):
headers='sys/types.h sys/socket.h',
define='HAVE_STRUCT_MSGHDR_MSG_CONTROL')
+ conf.CHECK_STRUCTURE_MEMBER('struct in_pktinfo',
+ 'ipi_addr',
+ headers='sys/types.h sys/socket.h netinet/in.h',
+ define='HAVE_STRUCT_IN_PKTINFO')
+
conf.CHECK_STRUCTURE_MEMBER('struct in6_pktinfo',
'ipi6_addr',
headers='sys/types.h sys/socket.h netinet/in.h',