mirror of
https://abf.rosa.ru/djam/dhcp.git
synced 2025-02-23 13:32:48 +00:00
40 lines
1 KiB
Diff
40 lines
1 KiB
Diff
diff -Naur -x '*~' -x '*.rej' -x '*.orig' dhcp-4.2.2/common/discover.c dhcp-4.2.2-missing-ipv6-not-fatal/common/discover.c
|
|
--- dhcp-4.2.2/common/discover.c 2011-07-20 00:22:48.000000000 +0200
|
|
+++ dhcp-4.2.2-missing-ipv6-not-fatal/common/discover.c 2011-09-12 13:33:04.300509236 +0200
|
|
@@ -455,7 +455,7 @@
|
|
}
|
|
|
|
#ifdef DHCPv6
|
|
- if (local_family == AF_INET6) {
|
|
+ if ((local_family == AF_INET6) && !access("/proc/net/if_inet6", R_OK)) {
|
|
ifaces->fp6 = fopen("/proc/net/if_inet6", "r");
|
|
if (ifaces->fp6 == NULL) {
|
|
log_error("Error opening '/proc/net/if_inet6' to "
|
|
@@ -466,6 +466,8 @@
|
|
ifaces->fp = NULL;
|
|
return 0;
|
|
}
|
|
+ } else {
|
|
+ ifaces->fp6 = NULL;
|
|
}
|
|
#endif
|
|
|
|
@@ -733,7 +735,7 @@
|
|
return 1;
|
|
}
|
|
#ifdef DHCPv6
|
|
- if (!(*err)) {
|
|
+ if (!(*err) && ifaces->fp6) {
|
|
if (local_family == AF_INET6)
|
|
return next_iface6(info, err, ifaces);
|
|
}
|
|
@@ -752,7 +754,8 @@
|
|
ifaces->sock = -1;
|
|
#ifdef DHCPv6
|
|
if (local_family == AF_INET6) {
|
|
- fclose(ifaces->fp6);
|
|
+ if (ifaces->fp6)
|
|
+ fclose(ifaces->fp6);
|
|
ifaces->fp6 = NULL;
|
|
}
|
|
#endif
|