summaryrefslogtreecommitdiffstats
path: root/src/kdc/network.c
diff options
context:
space:
mode:
authorKen Raeburn <raeburn@mit.edu>2008-07-14 15:19:25 +0000
committerKen Raeburn <raeburn@mit.edu>2008-07-14 15:19:25 +0000
commitfa8f0f47e086a9203a279fd41412f5409eead051 (patch)
tree95273d68e8f0396eb044ab3b587cc62546bac5b5 /src/kdc/network.c
parent6bb6b2a85c97148db10a53167b8a36bb9f1fb97c (diff)
downloadkrb5-fa8f0f47e086a9203a279fd41412f5409eead051.tar.gz
krb5-fa8f0f47e086a9203a279fd41412f5409eead051.tar.xz
krb5-fa8f0f47e086a9203a279fd41412f5409eead051.zip
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
Diffstat (limited to 'src/kdc/network.c')
-rw-r--r--src/kdc/network.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/kdc/network.c b/src/kdc/network.c
index bfb03a9d27..4b01ba4a9a 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: