wok diff dhcp6/stuff/start-without-ipv6.u @ rev 4098

syslinux: doc for xarg= argument
author Pascal Bellard <pascal.bellard@slitaz.org>
date Fri Sep 18 13:02:59 2009 +0200 (2009-09-18)
parents
children
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/dhcp6/stuff/start-without-ipv6.u	Fri Sep 18 13:02:59 2009 +0200
     1.3 @@ -0,0 +1,49 @@
     1.4 +--- dhcp-4.1.1b1/common/discover.c
     1.5 ++++ dhcp-4.1.1b1/common/discover.c
     1.6 +@@ -443,15 +443,17 @@
     1.7 + 	}
     1.8 + 
     1.9 + #ifdef DHCPv6
    1.10 +-	ifaces->fp6 = fopen("/proc/net/if_inet6", "r");
    1.11 +-	if (ifaces->fp6 == NULL) {
    1.12 +-		log_error("Error opening '/proc/net/if_inet6' to "
    1.13 +-			  "list IPv6 interfaces; %m");
    1.14 +-		close(ifaces->sock);
    1.15 +-		ifaces->sock = -1;
    1.16 +-		fclose(ifaces->fp);
    1.17 +-		ifaces->fp = NULL;
    1.18 +-		return 0;
    1.19 ++	if (local_family == AF_INET6) {
    1.20 ++		ifaces->fp6 = fopen("/proc/net/if_inet6", "r");
    1.21 ++		if (ifaces->fp6 == NULL) {
    1.22 ++			log_error("Error opening '/proc/net/if_inet6' to "
    1.23 ++				  "list IPv6 interfaces; %m");
    1.24 ++			close(ifaces->sock);
    1.25 ++			ifaces->sock = -1;
    1.26 ++			fclose(ifaces->fp);
    1.27 ++			ifaces->fp = NULL;
    1.28 ++			return 0;
    1.29 ++		}
    1.30 + 	}
    1.31 + #endif
    1.32 + 
    1.33 +@@ -720,7 +722,8 @@
    1.34 + 	}
    1.35 + #ifdef DHCPv6
    1.36 + 	if (!(*err)) {
    1.37 +-		return next_iface6(info, err, ifaces);
    1.38 ++		if (local_family == AF_INET6)
    1.39 ++			return next_iface6(info, err, ifaces);
    1.40 + 	}
    1.41 + #endif
    1.42 + 	return 0;
    1.43 +@@ -736,7 +739,8 @@
    1.44 + 	close(ifaces->sock);
    1.45 + 	ifaces->sock = -1;
    1.46 + #ifdef DHCPv6
    1.47 +-	fclose(ifaces->fp6);
    1.48 ++	if (local_family == AF_INET6)
    1.49 ++		fclose(ifaces->fp6);
    1.50 + 	ifaces->fp6 = NULL;
    1.51 + #endif
    1.52 + }