summaryrefslogtreecommitdiff
path: root/extra/dhcp/dhcp-4.2.5-missing_ipv6-1.patch
diff options
context:
space:
mode:
Diffstat (limited to 'extra/dhcp/dhcp-4.2.5-missing_ipv6-1.patch')
-rw-r--r--extra/dhcp/dhcp-4.2.5-missing_ipv6-1.patch48
1 files changed, 48 insertions, 0 deletions
diff --git a/extra/dhcp/dhcp-4.2.5-missing_ipv6-1.patch b/extra/dhcp/dhcp-4.2.5-missing_ipv6-1.patch
new file mode 100644
index 000000000..3a034c052
--- /dev/null
+++ b/extra/dhcp/dhcp-4.2.5-missing_ipv6-1.patch
@@ -0,0 +1,48 @@
+Submitted By: Ken Moffat <ken at linuxfromscratch dot org>
+Date: 2011-11-23
+Initial Package Version: 4.2.2
+Upstream Status: unknown
+Origin: found at fedora
+Description: Allow dhcp4 to work even if the kernel doesn't support ipv6.
+Fixed up by hand to apply to 4.2.2 (to me, it looks identical to the 4.2.0
+version, but patch failed in one hunk when I tried to apply that one).
+
+--- dhcp-4.2.2/common/discover.c.orig 2011-07-19 23:22:48.000000000 +0100
++++ dhcp-4.2.2/common/discover.c 2011-09-06 01:28:15.000000000 +0100
+@@ -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