From 8f48c8e61ce0865854c1cabd010737bf5fa0047b Mon Sep 17 00:00:00 2001 From: David Cantrell Date: Feb 18 2009 20:02:39 +0000 Subject: - Do not segfault if the ipv6 kernel module is not loaded (#486097) --- diff --git a/dhcp-4.1.0-missing-ipv6-not-fatal.patch b/dhcp-4.1.0-missing-ipv6-not-fatal.patch new file mode 100644 index 0000000..41d8369 --- /dev/null +++ b/dhcp-4.1.0-missing-ipv6-not-fatal.patch @@ -0,0 +1,36 @@ +diff -up dhcp-4.1.0/common/discover.c.noipv6 dhcp-4.1.0/common/discover.c +--- dhcp-4.1.0/common/discover.c.noipv6 2009-02-18 09:40:45.000000000 -1000 ++++ dhcp-4.1.0/common/discover.c 2009-02-18 09:43:53.000000000 -1000 +@@ -447,9 +447,11 @@ begin_iface_scan(struct iface_conf_list + if (ifaces->fp6 == NULL) { + log_error("Error opening '/proc/net/if_inet6' to " + "list IPv6 interfaces; %m"); +- close(ifaces->sock); ++ if (ifaces->sock) ++ close(ifaces->sock); + ifaces->sock = -1; +- fclose(ifaces->fp); ++ if (ifaces->fp) ++ fclose(ifaces->fp); + ifaces->fp = NULL; + return 0; + } +@@ -719,7 +721,7 @@ next_iface(struct iface_info *info, int + return 1; + } + #ifdef DHCPv6 +- if (!(*err)) { ++ if (!(*err) && ifaces->fp6) { + return next_iface6(info, err, ifaces); + } + #endif +@@ -736,7 +738,8 @@ end_iface_scan(struct iface_conf_list *i + close(ifaces->sock); + ifaces->sock = -1; + #ifdef DHCPv6 +- fclose(ifaces->fp6); ++ if (ifaces->fp6) ++ fclose(ifaces->fp6); + ifaces->fp6 = NULL; + #endif + } diff --git a/dhcp.spec b/dhcp.spec index 816adcb..a7168d0 100644 --- a/dhcp.spec +++ b/dhcp.spec @@ -4,7 +4,7 @@ Summary: Dynamic host configuration protocol software Name: dhcp Version: 4.1.0 -Release: 6%{?dist} +Release: 7%{?dist} # NEVER CHANGE THE EPOCH on this package. The previous maintainer (prior to # dcantrell maintaining the package) made incorrect use of the epoch and # that's why it is at 12 now. It should have never been used, but it was. @@ -43,6 +43,7 @@ Patch15: %{name}-4.1.0-inherit-leases.patch Patch16: %{name}-4.1.0-garbage-chars.patch Patch17: %{name}-4.1.0-port-validation.patch Patch18: %{name}-4.1.0-invalid-dhclient-conf.patch +Patch19: %{name}-4.1.0-missing-ipv6-not-fatal.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: autoconf @@ -177,6 +178,10 @@ libdhcpctl and libomapi static libraries are also included in this package. # (Submitted to dhcp-bugs@isc.org - [ISC-Bugs #19147]) %patch18 -p1 +# If the ipv6 kernel module is missing, do not segfault +# (Submitted to dhcp-bugs@isc.org - [ISC-Bugs #19367] +%patch19 -p1 + # Copy in documentation and example scripts for LDAP patch to dhcpd %{__install} -p -m 0644 %{SOURCE3} . %{__install} -p -m 0644 %{SOURCE4} doc/ @@ -414,6 +419,9 @@ fi %attr(0644,root,root) %{_mandir}/man3/omapi.3.gz %changelog +* Wed Feb 18 2009 David Cantrell - 12:4.1.0-7 +- Do not segfault if the ipv6 kernel module is not loaded (#486097) + * Mon Feb 16 2009 David Cantrell - 12:4.1.0-6 - Enable dhcpv6 support (#480798) - Fix config file migration in scriptlets (#480543)