d3e04d
diff -up dhcp-4.1.1/common/discover.c.noipv6 dhcp-4.1.1/common/discover.c
d3e04d
--- dhcp-4.1.1/common/discover.c.noipv6	2010-01-20 17:24:40.000000000 +0100
d3e04d
+++ dhcp-4.1.1/common/discover.c	2010-01-20 17:24:40.000000000 +0100
d3e04d
@@ -443,7 +443,7 @@ begin_iface_scan(struct iface_conf_list 
d3e04d
 	}
d3e04d
 
d3e04d
 #ifdef DHCPv6
d3e04d
-	if (local_family == AF_INET6) {
d3e04d
+	if ((local_family == AF_INET6) && !access("/proc/net/if_inet6", R_OK)) {
d3e04d
 		ifaces->fp6 = fopen("/proc/net/if_inet6", "re");
d3e04d
 		if (ifaces->fp6 == NULL) {
d3e04d
 			log_error("Error opening '/proc/net/if_inet6' to "
d3e04d
@@ -454,6 +454,8 @@ begin_iface_scan(struct iface_conf_list 
d3e04d
 			ifaces->fp = NULL;
d3e04d
 			return 0;
d3e04d
 		}
d3e04d
+	} else {
d3e04d
+		ifaces->fp6 = NULL;
d3e04d
 	}
d3e04d
 #endif
d3e04d
 
d3e04d
@@ -721,7 +723,7 @@ next_iface(struct iface_info *info, int 
d3e04d
 		return 1;
d3e04d
 	}
d3e04d
 #ifdef DHCPv6
d3e04d
-	if (!(*err)) {
d3e04d
+	if (!(*err) && ifaces->fp6) {
d3e04d
 		if (local_family == AF_INET6)
d3e04d
 			return next_iface6(info, err, ifaces);
d3e04d
 	}
d3e04d
@@ -740,7 +742,8 @@ end_iface_scan(struct iface_conf_list *i
d3e04d
 	ifaces->sock = -1;
d3e04d
 #ifdef DHCPv6
d3e04d
 	if (local_family == AF_INET6) {
d3e04d
-		fclose(ifaces->fp6);
d3e04d
+		if (ifaces->fp6)
d3e04d
+			fclose(ifaces->fp6);
d3e04d
 		ifaces->fp6 = NULL;
d3e04d
 	}
d3e04d
 #endif