philipp / rpms / dhcp

Forked from rpms/dhcp 4 years ago
Clone

Blame SOURCES/dhcp-4.2.5-ipv6-bind-to-interface.patch

c8bb8f
Index: dhcp-4.2.5-P1/common/socket.c
c8bb8f
===================================================================
c8bb8f
--- dhcp-4.2.5-P1.orig/common/socket.c
c8bb8f
+++ dhcp-4.2.5-P1/common/socket.c
c8bb8f
@@ -227,7 +227,7 @@ if_register_socket(struct interface_info
c8bb8f
 		flag = 1;
c8bb8f
 		if (setsockopt(sock, SOL_SOCKET, SO_REUSEPORT,
c8bb8f
 			       (char *)&flag, sizeof(flag)) < 0) {
c8bb8f
-			log_fatal("Can't set SO_REUSEPORT option on dhcp "
c8bb8f
+			log_error("Can't set SO_REUSEPORT option on dhcp "
c8bb8f
 				  "socket: %m");
c8bb8f
 		}
c8bb8f
 	}
c8bb8f
@@ -245,10 +245,10 @@ if_register_socket(struct interface_info
c8bb8f
 
c8bb8f
 #if defined(SO_BINDTODEVICE)
c8bb8f
 	/* Bind this socket to this interface. */
c8bb8f
-	if ((local_family != AF_INET6) && (info->ifp != NULL) &&
c8bb8f
+	if ((!do_multicast || !*do_multicast) && info->ifp &&
c8bb8f
 	    setsockopt(sock, SOL_SOCKET, SO_BINDTODEVICE,
c8bb8f
 			(char *)(info -> ifp), sizeof(*(info -> ifp))) < 0) {
c8bb8f
-		log_fatal("setsockopt: SO_BINDTODEVICE: %m");
c8bb8f
+		log_error("setsockopt: SO_BINDTODEVICE: %m");
c8bb8f
 	}
c8bb8f
 #endif
c8bb8f