wok-current view dhcp6/stuff/start-without-ipv6.u @ rev 3814

Add a2ps
author Pascal Bellard <pascal.bellard@slitaz.org>
date Thu Aug 06 09:52:36 2009 +0200 (2009-08-06)
parents
children
line source
1 --- dhcp-4.1.1b1/common/discover.c
2 +++ dhcp-4.1.1b1/common/discover.c
3 @@ -443,15 +443,17 @@
4 }
6 #ifdef DHCPv6
7 - ifaces->fp6 = fopen("/proc/net/if_inet6", "r");
8 - if (ifaces->fp6 == NULL) {
9 - log_error("Error opening '/proc/net/if_inet6' to "
10 - "list IPv6 interfaces; %m");
11 - close(ifaces->sock);
12 - ifaces->sock = -1;
13 - fclose(ifaces->fp);
14 - ifaces->fp = NULL;
15 - return 0;
16 + if (local_family == AF_INET6) {
17 + ifaces->fp6 = fopen("/proc/net/if_inet6", "r");
18 + if (ifaces->fp6 == NULL) {
19 + log_error("Error opening '/proc/net/if_inet6' to "
20 + "list IPv6 interfaces; %m");
21 + close(ifaces->sock);
22 + ifaces->sock = -1;
23 + fclose(ifaces->fp);
24 + ifaces->fp = NULL;
25 + return 0;
26 + }
27 }
28 #endif
30 @@ -720,7 +722,8 @@
31 }
32 #ifdef DHCPv6
33 if (!(*err)) {
34 - return next_iface6(info, err, ifaces);
35 + if (local_family == AF_INET6)
36 + return next_iface6(info, err, ifaces);
37 }
38 #endif
39 return 0;
40 @@ -736,7 +739,8 @@
41 close(ifaces->sock);
42 ifaces->sock = -1;
43 #ifdef DHCPv6
44 - fclose(ifaces->fp6);
45 + if (local_family == AF_INET6)
46 + fclose(ifaces->fp6);
47 ifaces->fp6 = NULL;
48 #endif
49 }