diff options
author | Tobias Brunner <tobias@strongswan.org> | 2011-10-13 19:23:10 +0200 |
---|---|---|
committer | Tobias Brunner <tobias@strongswan.org> | 2011-10-13 19:23:10 +0200 |
commit | 03ef4e34610a3c0cd2e273ff01d24b3b62fbf847 (patch) | |
tree | 898b743dd063d7f34699566a8c883c0b48569083 /src/libcharon/plugins/socket_raw/socket_raw_socket.c | |
parent | c27c9529b746ac7bb92eac0ecfb102db8327576d (diff) | |
download | strongswan-03ef4e34610a3c0cd2e273ff01d24b3b62fbf847.tar.bz2 strongswan-03ef4e34610a3c0cd2e273ff01d24b3b62fbf847.tar.xz |
Android does not support 'struct in6_pktinfo'.
Diffstat (limited to 'src/libcharon/plugins/socket_raw/socket_raw_socket.c')
-rw-r--r-- | src/libcharon/plugins/socket_raw/socket_raw_socket.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/libcharon/plugins/socket_raw/socket_raw_socket.c b/src/libcharon/plugins/socket_raw/socket_raw_socket.c index 242d098cf..f371ed502 100644 --- a/src/libcharon/plugins/socket_raw/socket_raw_socket.c +++ b/src/libcharon/plugins/socket_raw/socket_raw_socket.c @@ -31,7 +31,6 @@ #include <sys/ioctl.h> #include <netinet/in.h> #include <netinet/ip.h> -#include <netinet/ip6.h> #include <netinet/udp.h> #include <linux/types.h> #include <linux/filter.h> @@ -259,6 +258,8 @@ METHOD(socket_t, receiver, status_t, DBG1(DBG_NET, "error reading IPv6 ancillary data"); return FAILED; } + +#ifdef HAVE_IN6_PKTINFO if (cmsgptr->cmsg_level == SOL_IPV6 && cmsgptr->cmsg_type == IPV6_2292PKTINFO) { @@ -273,6 +274,7 @@ METHOD(socket_t, receiver, status_t, src.sin6_port = udp->source; dest = host_create_from_sockaddr((sockaddr_t*)&dst); } +#endif /* HAVE_IN6_PKTINFO */ } /* ancillary data missing? */ if (dest == NULL) @@ -397,6 +399,7 @@ METHOD(socket_t, sender, status_t, sin = (struct sockaddr_in*)src->get_sockaddr(src); memcpy(&pktinfo->ipi_spec_dst, &sin->sin_addr, sizeof(struct in_addr)); } +#ifdef HAVE_IN6_PKTINFO else { char buf[CMSG_SPACE(sizeof(struct in6_pktinfo))]; @@ -414,6 +417,7 @@ METHOD(socket_t, sender, status_t, sin = (struct sockaddr_in6*)src->get_sockaddr(src); memcpy(&pktinfo->ipi6_addr, &sin->sin6_addr, sizeof(struct in6_addr)); } +#endif /* HAVE_IN6_PKTINFO */ } bytes_sent = sendmsg(skt, &msg, 0); |