From: Ken Raeburn Date: Sat, 3 Apr 2004 01:52:46 +0000 (+0000) Subject: * network.c (setup_a_tcp_listener): Try to turn the IPV6_V6ONLY socket option X-Git-Tag: krb5-1.4-beta1~500 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=284a093555f87a71bb5b2a0701146830d8ba6dff;p=krb5.git * network.c (setup_a_tcp_listener): Try to turn the IPV6_V6ONLY socket option on, not off, and do it before calling bind. (setup_tcp_listener_ports): Don't do it here any more. (setup_udp_port): Ignore AF_DLI addresses. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@16234 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/kdc/ChangeLog b/src/kdc/ChangeLog index 996aa442a..e9aadebf0 100644 --- a/src/kdc/ChangeLog +++ b/src/kdc/ChangeLog @@ -1,3 +1,10 @@ +2004-04-02 Ken Raeburn + + * network.c (setup_a_tcp_listener): Try to turn the IPV6_V6ONLY + socket option on, not off, and do it before calling bind. + (setup_tcp_listener_ports): Don't do it here any more. + (setup_udp_port): Ignore AF_DLI addresses. + 2004-03-22 Ken Raeburn * network.c (delete_fd): Free pointed-to data after removing it diff --git a/src/kdc/network.c b/src/kdc/network.c index ddbdf3533..7ef102bba 100644 --- a/src/kdc/network.c +++ b/src/kdc/network.c @@ -362,6 +362,18 @@ setup_a_tcp_listener(struct socksetup *data, struct sockaddr *addr) if (setreuseaddr(sock, 1) < 0) com_err(data->prog, errno, "Cannot enable SO_REUSEADDR on fd %d", sock); +#ifdef KRB5_USE_INET6 + if (addr->sa_family == AF_INET6) { +#ifdef IPV6_V6ONLY + if (setv6only(sock, 1)) + com_err(data->prog, errno, "setsockopt(IPV6_V6ONLY,1) failed"); + else + com_err(data->prog, 0, "setsockopt(IPV6_V6ONLY,1) worked"); +#else + krb5_klog_syslog(LOG_INFO, "no IPV6_V6ONLY socket option support"); +#endif /* IPV6_V6ONLY */ + } +#endif /* KRB5_USE_INET6 */ if (bind(sock, addr, socklen(addr)) == -1) { com_err(data->prog, errno, "Cannot bind TCP server socket on %s", paddr(addr)); @@ -435,14 +447,6 @@ setup_tcp_listener_ports(struct socksetup *data) s6 = setup_a_tcp_listener(data, (struct sockaddr *)&sin6); if (s6 < 0) return -1; -#ifdef IPV6_V6ONLY - if (setv6only(s6, 0)) - com_err(data->prog, errno, "setsockopt(IPV6_V6ONLY,0) failed"); - else - com_err(data->prog, 0, "setsockopt(IPV6_V6ONLY,0) worked"); -#else - krb5_klog_syslog(LOG_INFO, "no IPV6_V6ONLY socket option support"); -#endif s4 = setup_a_tcp_listener(data, (struct sockaddr *)&sin4); #endif /* KRB5_USE_INET6 */ @@ -514,6 +518,10 @@ setup_udp_port(void *P_data, struct sockaddr *addr) #ifdef AF_LINK /* some BSD systems, AIX */ case AF_LINK: return 0; +#endif +#ifdef AF_DLI /* Direct Link Interface - DEC Ultrix/OSF1 link layer? */ + case AF_DLI: + return 0; #endif default: krb5_klog_syslog (LOG_INFO,