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