Fixed ip_packet_t if IPv6 is not available
This commit is contained in:
@@ -431,6 +431,7 @@ AC_CHECK_FUNCS(prctl mallinfo getpass closefrom getpwnam_r getgrnam_r)
|
|||||||
|
|
||||||
AC_CHECK_HEADERS(sys/sockio.h glob.h)
|
AC_CHECK_HEADERS(sys/sockio.h glob.h)
|
||||||
AC_CHECK_HEADERS(net/pfkeyv2.h netipsec/ipsec.h netinet6/ipsec.h linux/udp.h)
|
AC_CHECK_HEADERS(net/pfkeyv2.h netipsec/ipsec.h netinet6/ipsec.h linux/udp.h)
|
||||||
|
AC_CHECK_HEADERS(netinet/ip6.h)
|
||||||
|
|
||||||
AC_CHECK_MEMBERS([struct sockaddr.sa_len], [], [],
|
AC_CHECK_MEMBERS([struct sockaddr.sa_len], [], [],
|
||||||
[
|
[
|
||||||
|
|||||||
@@ -21,7 +21,9 @@
|
|||||||
|
|
||||||
#include <netinet/in.h>
|
#include <netinet/in.h>
|
||||||
#include <netinet/ip.h>
|
#include <netinet/ip.h>
|
||||||
|
#ifdef HAVE_NETINET_IP6_H
|
||||||
#include <netinet/ip6.h>
|
#include <netinet/ip6.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
typedef struct private_ip_packet_t private_ip_packet_t;
|
typedef struct private_ip_packet_t private_ip_packet_t;
|
||||||
|
|
||||||
@@ -143,6 +145,7 @@ ip_packet_t *ip_packet_create(chunk_t packet)
|
|||||||
next_header = ip->protocol;
|
next_header = ip->protocol;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
#ifdef HAVE_NETINET_IP6_H
|
||||||
case 6:
|
case 6:
|
||||||
{
|
{
|
||||||
struct ip6_hdr *ip;
|
struct ip6_hdr *ip;
|
||||||
@@ -159,6 +162,7 @@ ip_packet_t *ip_packet_create(chunk_t packet)
|
|||||||
chunk_from_thing(ip->ip6_dst), 0);
|
chunk_from_thing(ip->ip6_dst), 0);
|
||||||
next_header = ip->ip6_nxt;
|
next_header = ip->ip6_nxt;
|
||||||
}
|
}
|
||||||
|
#endif /* HAVE_NETINET_IP6_H */
|
||||||
default:
|
default:
|
||||||
DBG1(DBG_ESP, "unsupported IP version");
|
DBG1(DBG_ESP, "unsupported IP version");
|
||||||
goto failed;
|
goto failed;
|
||||||
|
|||||||
Reference in New Issue
Block a user