/[pkgs]/devel/dhcp/dhcp-4.1.0-missing-ipv6-not-fatal.patch
ViewVC logotype

Contents of /devel/dhcp/dhcp-4.1.0-missing-ipv6-not-fatal.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (show annotations) (download) (as text)
Wed Feb 18 21:24:21 2009 UTC (9 months ago) by dcantrel
Branch: MAIN
CVS Tags: F-12-split, dhcp-4_1_0-22_fc12, dhcp-4_1_0-20_fc12, dhcp-4_1_0p1-5_fc12, dhcp-4_1_0-16_fc11, dhcp-4_1_0p1-13_fc13, dhcp-4_1_0-11_fc11, dhcp-4_1_0p1-11_fc12, dhcp-4_1_0-10_fc11, dhcp-4_1_0-15_fc11, dhcp-4_1_0-12_fc11, dhcp-4_1_0-14_fc11, F-11-split, dhcp-4_1_0p1-6_fc12, dhcp-4_1_0p1-7_fc12, dhcp-4_1_0p1-8_fc12, dhcp-4_1_0p1-4_fc12, dhcp-4_1_0-13_fc11, dhcp-4_1_0-18_fc12, dhcp-4_1_0p1-14_fc13, dhcp-4_1_0-23_fc12, dhcp-4_1_0-17_fc12, dhcp-4_1_0-19_fc12, dhcp-4_1_0p1-1_fc12, dhcp-4_1_0p1-3_fc12, dhcp-4_1_0p1-9_fc12, dhcp-4_1_0-9_fc11, dhcp-4_1_0p1-12_fc13, dhcp-4_1_0-26_fc12, dhcp-4_1_0p1-10_fc12, dhcp-4_1_0-8_fc11, dhcp-4_1_0-25_fc12, dhcp-4_1_0-24_fc12, dhcp-4_1_0-7_fc11, dhcp-4_1_0-27_fc12, dhcp-4_1_0-21_fc12, dhcp-4_1_0p1-2_fc12, HEAD
Changes since 1.1: +29 -14 lines
File MIME type: text/x-patch
* Wed Feb 18 2009 David Cantrell <dcantrell@redhat.com> - 12:4.1.0-7
- Do not segfault if the ipv6 kernel module is not loaded (#486097)
1 diff -up dhcp-4.1.0/common/discover.c.noipv6 dhcp-4.1.0/common/discover.c
2 --- dhcp-4.1.0/common/discover.c.noipv6 2009-02-18 10:44:20.000000000 -1000
3 +++ dhcp-4.1.0/common/discover.c 2009-02-18 10:48:27.000000000 -1000
4 @@ -443,15 +443,19 @@ begin_iface_scan(struct iface_conf_list
5 }
6
7 #ifdef DHCPv6
8 - ifaces->fp6 = fopen("/proc/net/if_inet6", "re");
9 - if (ifaces->fp6 == NULL) {
10 - log_error("Error opening '/proc/net/if_inet6' to "
11 - "list IPv6 interfaces; %m");
12 - close(ifaces->sock);
13 - ifaces->sock = -1;
14 - fclose(ifaces->fp);
15 - ifaces->fp = NULL;
16 - return 0;
17 + if (!access("/proc/net/if_inet6", R_OK)) {
18 + ifaces->fp6 = fopen("/proc/net/if_inet6", "re");
19 + if (ifaces->fp6 == NULL) {
20 + log_error("Error opening '/proc/net/if_inet6' to "
21 + "list IPv6 interfaces; %m");
22 + close(ifaces->sock);
23 + ifaces->sock = -1;
24 + fclose(ifaces->fp);
25 + ifaces->fp = NULL;
26 + return 0;
27 + }
28 + } else {
29 + ifaces->fp6 = NULL;
30 }
31 #endif
32
33 @@ -719,7 +723,7 @@ next_iface(struct iface_info *info, int
34 return 1;
35 }
36 #ifdef DHCPv6
37 - if (!(*err)) {
38 + if (!(*err) && ifaces->fp6) {
39 return next_iface6(info, err, ifaces);
40 }
41 #endif
42 @@ -736,7 +740,8 @@ end_iface_scan(struct iface_conf_list *i
43 close(ifaces->sock);
44 ifaces->sock = -1;
45 #ifdef DHCPv6
46 - fclose(ifaces->fp6);
47 + if (ifaces->fp6)
48 + fclose(ifaces->fp6);
49 ifaces->fp6 = NULL;
50 #endif
51 }

admin@fedoraproject.org
ViewVC Help
Powered by ViewVC 1.1.2