From fa8f0f47e086a9203a279fd41412f5409eead051 Mon Sep 17 00:00:00 2001 From: Ken Raeburn Date: Mon, 14 Jul 2008 15:19:25 +0000 Subject: [PATCH] Use RFC 3542's IPV6_RECVPKTINFO if available. (And IP_RECVPKTINFO too.) git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@20515 dc483132-0cff-0310-8789-dd5450dbe970 --- src/kdc/network.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/kdc/network.c b/src/kdc/network.c index bfb03a9d2..4b01ba4a9 100644 --- a/src/kdc/network.c +++ b/src/kdc/network.c @@ -115,6 +115,16 @@ setv6only(int sock, int value) } #endif +/* Use RFC 3542 API below, but fall back from IPV6_RECVPKTINFO to + IPV6_PKTINFO for RFC 2292 implementations. */ +#ifndef IPV6_RECVPKTINFO +#define IPV6_RECVPKTINFO IPV6_PKTINFO +#endif +/* Parallel, though not standardized. */ +#ifndef IP_RECVPKTINFO +#define IP_RECVPKTINFO IP_PKTINFO +#endif + static int set_pktinfo(int sock, int family) { @@ -125,13 +135,13 @@ set_pktinfo(int sock, int family) #if defined(IP_PKTINFO) && defined(HAVE_STRUCT_IN_PKTINFO) case AF_INET: proto = IPPROTO_IP; - option = IP_PKTINFO; + option = IP_RECVPKTINFO; break; #endif #if defined(IPV6_PKTINFO) && defined(HAVE_STRUCT_IN6_PKTINFO) case AF_INET6: proto = IPPROTO_IPV6; - option = IPV6_PKTINFO; + option = IPV6_RECVPKTINFO; break; #endif default: -- 2.26.2