summaryrefslogtreecommitdiffstats
path: root/main/dhcp/linux_ipv6_discover.patch
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2009-08-18 08:31:39 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2009-08-18 08:31:39 +0000
commitdb5d9d6dcaa35ca33f48383464e0be66903f1bfa (patch)
treee2823274e66adeb815833bf81dfdc43eae88fc7e /main/dhcp/linux_ipv6_discover.patch
parentec2a7df9bc61e5f83762f23a3ad7f670d0b8ca92 (diff)
downloadaports-db5d9d6dcaa35ca33f48383464e0be66903f1bfa.tar.bz2
aports-db5d9d6dcaa35ca33f48383464e0be66903f1bfa.tar.xz
main/dhcp: fix for non-existing ipv6
Patch from here: https://lists.isc.org/pipermail/dhcp-hackers/2008-October/001761.html
Diffstat (limited to 'main/dhcp/linux_ipv6_discover.patch')
-rw-r--r--main/dhcp/linux_ipv6_discover.patch50
1 files changed, 50 insertions, 0 deletions
diff --git a/main/dhcp/linux_ipv6_discover.patch b/main/dhcp/linux_ipv6_discover.patch
new file mode 100644
index 000000000..ebf3865e6
--- /dev/null
+++ b/main/dhcp/linux_ipv6_discover.patch
@@ -0,0 +1,50 @@
+diff -Naur dhcp-4.1.0a2/common/discover.c dhcp-4.1.0a2-mcn/common/discover.c
+--- dhcp-4.1.0a2/common/discover.c 2008-08-29 18:48:57.000000000 +0100
++++ dhcp-4.1.0a2-mcn/common/discover.c 2008-10-02 13:02:06.000000000 +0100
+@@ -443,15 +443,17 @@
+ }
+
+ #ifdef DHCPv6
+- ifaces->fp6 = fopen("/proc/net/if_inet6", "r");
+- if (ifaces->fp6 == NULL) {
+- log_error("Error opening '/proc/net/if_inet6' to "
+- "list IPv6 interfaces; %m");
+- close(ifaces->sock);
+- ifaces->sock = -1;
+- fclose(ifaces->fp);
+- ifaces->fp = NULL;
+- return 0;
++ if (local_family == AF_INET6) {
++ ifaces->fp6 = fopen("/proc/net/if_inet6", "r");
++ if (ifaces->fp6 == NULL) {
++ log_error("Error opening '/proc/net/if_inet6' to "
++ "list IPv6 interfaces; %m");
++ close(ifaces->sock);
++ ifaces->sock = -1;
++ fclose(ifaces->fp);
++ ifaces->fp = NULL;
++ return 0;
++ }
+ }
+ #endif
+
+@@ -720,7 +722,8 @@
+ }
+ #ifdef DHCPv6
+ if (!(*err)) {
+- return next_iface6(info, err, ifaces);
++ if (local_family == AF_INET6)
++ return next_iface6(info, err, ifaces);
+ }
+ #endif
+ return 0;
+@@ -736,7 +739,8 @@
+ close(ifaces->sock);
+ ifaces->sock = -1;
+ #ifdef DHCPv6
+- fclose(ifaces->fp6);
++ if (local_family == AF_INET6)
++ fclose(ifaces->fp6);
+ ifaces->fp6 = NULL;
+ #endif
+ }