5a3797e
diff -up dhcp-4.2.0/common/discover.c.noipv6 dhcp-4.2.0/common/discover.c
5a3797e
--- dhcp-4.2.0/common/discover.c.noipv6	2010-07-21 14:31:13.000000000 +0200
5a3797e
+++ dhcp-4.2.0/common/discover.c	2010-07-21 16:04:57.000000000 +0200
9538db2
@@ -443,7 +443,7 @@ begin_iface_scan(struct iface_conf_list 
9538db2
 	}
9538db2
 
9538db2
 #ifdef DHCPv6
9538db2
-	if (local_family == AF_INET6) {
9538db2
+	if ((local_family == AF_INET6) && !access("/proc/net/if_inet6", R_OK)) {
9538db2
 		ifaces->fp6 = fopen("/proc/net/if_inet6", "re");
9538db2
 		if (ifaces->fp6 == NULL) {
9538db2
 			log_error("Error opening '/proc/net/if_inet6' to "
9538db2
@@ -454,6 +454,8 @@ begin_iface_scan(struct iface_conf_list 
9538db2
 			ifaces->fp = NULL;
9538db2
 			return 0;
9538db2
 		}
9538db2
+	} else {
9538db2
+		ifaces->fp6 = NULL;
9538db2
 	}
9538db2
 #endif
9538db2
 
9538db2
@@ -721,7 +723,7 @@ next_iface(struct iface_info *info, int 
9538db2
 		return 1;
9538db2
 	}
9538db2
 #ifdef DHCPv6
9538db2
-	if (!(*err)) {
9538db2
+	if (!(*err) && ifaces->fp6) {
9538db2
 		if (local_family == AF_INET6)
9538db2
 			return next_iface6(info, err, ifaces);
9538db2
 	}
9538db2
@@ -740,7 +742,8 @@ end_iface_scan(struct iface_conf_list *i
9538db2
 	ifaces->sock = -1;
9538db2
 #ifdef DHCPv6
9538db2
 	if (local_family == AF_INET6) {
9538db2
-		fclose(ifaces->fp6);
9538db2
+		if (ifaces->fp6)
9538db2
+			fclose(ifaces->fp6);
9538db2
 		ifaces->fp6 = NULL;
9538db2
 	}
9538db2
 #endif