[arch-commits] Commit in dhcp/repos/extra-i686 (1 file)

Kevin Piché kevin at archlinux.org
Wed Sep 9 03:53:11 UTC 2009


    Date: Tuesday, September 8, 2009 @ 23:53:11
  Author: kevin
Revision: 51492

Added missing patch

Added:
  dhcp/repos/extra-i686/dhcp-4.1.0-missing-ipv6-not-fatal.patch

-----------------------------------------+
 dhcp-4.1.0-missing-ipv6-not-fatal.patch |   54 ++++++++++++++++++++++++++++++
 1 file changed, 54 insertions(+)

Added: dhcp-4.1.0-missing-ipv6-not-fatal.patch
===================================================================
--- dhcp-4.1.0-missing-ipv6-not-fatal.patch	                        (rev 0)
+++ dhcp-4.1.0-missing-ipv6-not-fatal.patch	2009-09-09 03:53:11 UTC (rev 51492)
@@ -0,0 +1,54 @@
+Based on patch from redhat:  http://cvs.fedoraproject.org/viewvc/devel/dhcp/dhcp-4.1.0-missing-ipv6-not-fatal.patch?revision=1.2
+
+--- common/discover.c.orig	2008-08-29 13:48:57.000000000 -0400
++++ common/discover.c	2009-09-08 23:32:45.000000000 -0400
+@@ -443,16 +443,20 @@
+ 	}
+ 
+ #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 (!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 "
++				  "list IPv6 interfaces; %m");
++			close(ifaces->sock);
++			ifaces->sock = -1;
++			fclose(ifaces->fp);
++			ifaces->fp = NULL;
++			return 0;
++		}
++ 	} else {
++ 		ifaces->fp6 = NULL;
++  	}
+ #endif
+ 
+ 	return 1;
+@@ -719,7 +723,7 @@
+ 		return 1;
+ 	}
+ #ifdef DHCPv6
+-	if (!(*err)) {
++	if (!(*err) && ifaces->fp6) {
+ 		return next_iface6(info, err, ifaces);
+ 	}
+ #endif
+@@ -736,7 +740,8 @@
+ 	close(ifaces->sock);
+ 	ifaces->sock = -1;
+ #ifdef DHCPv6
+-	fclose(ifaces->fp6);
++	if (ifaces->fp6)
++		fclose(ifaces->fp6);
+ 	ifaces->fp6 = NULL;
+ #endif
+ }




More information about the arch-commits mailing list