[arch-commits] Commit in dhcp/trunk (PKGBUILD dhcp-4.1.0-missing-ipv6-not-fatal.patch)

Kevin Piché kevin at archlinux.org
Wed Sep 9 03:50:29 UTC 2009


    Date: Tuesday, September 8, 2009 @ 23:50:29
  Author: kevin
Revision: 51490

upgpkg: dhcp 4.1.0.p1-1
    Updated version and added no ipv6 patch for x86_64

Added:
  dhcp/trunk/dhcp-4.1.0-missing-ipv6-not-fatal.patch
Modified:
  dhcp/trunk/PKGBUILD

-----------------------------------------+
 PKGBUILD                                |    8 ++--
 dhcp-4.1.0-missing-ipv6-not-fatal.patch |   54 ++++++++++++++++++++++++++++++
 2 files changed, 59 insertions(+), 3 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2009-09-09 01:44:40 UTC (rev 51489)
+++ PKGBUILD	2009-09-09 03:50:29 UTC (rev 51490)
@@ -6,7 +6,7 @@
 _pkgver=4.1.0p1
 pkgrel=1
 pkgdesc="A DHCP server, client, and relay agent"
-arch=(i686 x86_64)
+arch=('i686' 'x86_64')
 license=('custom:isc-dhcp')
 url="https://www.isc.org/software/dhcp"
 depends=('openssl>=0.9.8a')
@@ -15,14 +15,14 @@
 source=(http://ftp.isc.org/isc/${pkgname}/${pkgname}-${_pkgver}.tar.gz
 dhcpd dhcp.conf.d dhcp-4.1.0-missing-ipv6-not-fatal.patch)
 md5sums=('325ff8338c5a21f89d5304ac13ffebdf' 'df22cffa7d7415ece7bb025b7bf774dd'
-         '49da3192e5c885e3c7d02f447c2dea5e' '401eb8819fc1d10fda3f8e02ad9fe421')
+         '49da3192e5c885e3c7d02f447c2dea5e' '463fe58e8ba594b1946d77f685f9f5f5')
 
 build() {
   cd ${srcdir}/${pkgname}-${_pkgver}
   # Define _GNU_SOURCE to fix IPV6.
   sed '/^CFLAGS="$CFLAGS/ s/INGS"/INGS -D_GNU_SOURCE"/' -i configure
   # Make not having ipv6 non-fatal.
-  patch -Np1 -i ${srcdir}/dhcp-4.1.0-missing-ipv6-not-fatal.patch
+  patch -Np0 -i ${srcdir}/dhcp-4.1.0-missing-ipv6-not-fatal.patch
   ./configure --prefix=/usr --sysconfdir=/etc \
       --with-srv-lease-file=/var/state/dhcp/dhcpd.leases \
       --with-srv6-lease-file=/var/state/dhcp/dhcpd6.leases
@@ -39,3 +39,5 @@
   install -m644 -D ${srcdir}/${pkgname}-${_pkgver}/LICENSE \
                    ${pkgdir}/usr/share/licenses/dhcp/LICENSE
 }
+md5sums=('325ff8338c5a21f89d5304ac13ffebdf' 'df22cffa7d7415ece7bb025b7bf774dd'
+         '49da3192e5c885e3c7d02f447c2dea5e' 'edf327eabb82e54b1e9d80b2750134ed')

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:50:29 UTC (rev 51490)
@@ -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