* network.c (setup_a_tcp_listener): Try to turn the IPV6_V6ONLY socket option
authorKen Raeburn <raeburn@mit.edu>
Sat, 3 Apr 2004 01:52:46 +0000 (01:52 +0000)
committerKen Raeburn <raeburn@mit.edu>
Sat, 3 Apr 2004 01:52:46 +0000 (01:52 +0000)
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

src/kdc/ChangeLog
src/kdc/network.c

index 996aa442a372c3f99824543d2efd10b5df47de48..e9aadebf0ac7d5185f5c751966b7dce13d3a177a 100644 (file)
@@ -1,3 +1,10 @@
+2004-04-02  Ken Raeburn  <raeburn@mit.edu>
+
+       * 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  <raeburn@mit.edu>
 
        * network.c (delete_fd): Free pointed-to data after removing it
index ddbdf353369294f169e9e3bbc515064c4f26ffec..7ef102bba2112e869b41844c4fdec7c7590d2a59 100644 (file)
@@ -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,