diff options
-rw-r--r-- | libbb/udp_io.c | 8 | ||||
-rw-r--r-- | networking/traceroute.c | 8 |
2 files changed, 9 insertions, 7 deletions
diff --git a/libbb/udp_io.c b/libbb/udp_io.c index 6e3ef484e..68355e6c4 100644 --- a/libbb/udp_io.c +++ b/libbb/udp_io.c @@ -8,6 +8,10 @@ */ #include "libbb.h" +#if defined(IPV6_PKTINFO) && !defined(IPV6_RECVPKTINFO) +# define IPV6_RECVPKTINFO IPV6_PKTINFO +#endif + /* * This asks kernel to let us know dst addr/port of incoming packets * We don't check for errors here. Not supported == won't be used @@ -18,8 +22,8 @@ socket_want_pktinfo(int fd UNUSED_PARAM) #ifdef IP_PKTINFO setsockopt_1(fd, IPPROTO_IP, IP_PKTINFO); #endif -#if ENABLE_FEATURE_IPV6 && defined(IPV6_PKTINFO) - setsockopt_1(fd, IPPROTO_IPV6, IPV6_PKTINFO); +#if ENABLE_FEATURE_IPV6 && defined(IPV6_RECVPKTINFO) + setsockopt_1(fd, IPPROTO_IPV6, IPV6_RECVPKTINFO); #endif } diff --git a/networking/traceroute.c b/networking/traceroute.c index df7122047..6dcbc2faa 100644 --- a/networking/traceroute.c +++ b/networking/traceroute.c @@ -311,6 +311,9 @@ # ifndef SOL_IPV6 # define SOL_IPV6 IPPROTO_IPV6 # endif +# if defined(IPV6_PKTINFO) && !defined(IPV6_RECVPKTINFO) +# define IPV6_RECVPKTINFO IPV6_PKTINFO +# endif #endif #include "libbb.h" @@ -911,12 +914,7 @@ common_traceroute_main(int op, char **argv) #if ENABLE_TRACEROUTE6 if (af == AF_INET6) { xmove_fd(xsocket(AF_INET6, SOCK_RAW, IPPROTO_ICMPV6), rcvsock); -# ifdef IPV6_RECVPKTINFO setsockopt_1(rcvsock, SOL_IPV6, IPV6_RECVPKTINFO); - setsockopt_1(rcvsock, SOL_IPV6, IPV6_2292PKTINFO); -# else - setsockopt_1(rcvsock, SOL_IPV6, IPV6_PKTINFO); -# endif } else #endif { |