[dhcp] improve #449946 fix (#806342)

Jiří Popelka jpopelka at fedoraproject.org
Fri Mar 23 17:25:41 UTC 2012


commit 5809fa55843d54996fe372c3e31fa7ad862b21e6
Author: Jiri Popelka <jpopelka at redhat.com>
Date:   Fri Mar 23 18:22:01 2012 +0100

    improve #449946 fix (#806342)

 dhcp-4.2.3-P2-getifaddrs.patch |   29 ++++++++++++++++++++++-------
 dhcp.spec                      |    5 ++++-
 2 files changed, 26 insertions(+), 8 deletions(-)
---
diff --git a/dhcp-4.2.3-P2-getifaddrs.patch b/dhcp-4.2.3-P2-getifaddrs.patch
index ef9093f..1473c65 100644
--- a/dhcp-4.2.3-P2-getifaddrs.patch
+++ b/dhcp-4.2.3-P2-getifaddrs.patch
@@ -1,6 +1,6 @@
 diff -up dhcp-4.2.3-P2/common/discover.c.getifaddrs dhcp-4.2.3-P2/common/discover.c
---- dhcp-4.2.3-P2/common/discover.c.getifaddrs	2012-03-21 16:28:08.537760099 +0100
-+++ dhcp-4.2.3-P2/common/discover.c	2012-03-21 16:29:58.134389955 +0100
+--- dhcp-4.2.3-P2/common/discover.c.getifaddrs	2012-03-23 18:07:54.744082263 +0100
++++ dhcp-4.2.3-P2/common/discover.c	2012-03-23 18:14:37.213050709 +0100
 @@ -379,394 +379,13 @@ end_iface_scan(struct iface_conf_list *i
  	ifaces->sock = -1;
  }
@@ -397,16 +397,31 @@ diff -up dhcp-4.2.3-P2/common/discover.c.getifaddrs dhcp-4.2.3-P2/common/discove
   * function.
   *
   * The getifaddrs() man page describes the use.
-@@ -826,7 +445,12 @@ next_iface(struct iface_info *info, int
+@@ -814,6 +433,8 @@ begin_iface_scan(struct iface_conf_list
+  */
+ int
+ next_iface(struct iface_info *info, int *err, struct iface_conf_list *ifaces) {
++	size_t sa_len = 0;
++
+ 	if (ifaces->next == NULL) {
+ 		*err = 0;
+ 		return 0;
+@@ -825,8 +446,16 @@ next_iface(struct iface_info *info, int
+ 		return 0;
  	}
  	strcpy(info->name, ifaces->next->ifa_name);
- 	memcpy(&info->addr, ifaces->next->ifa_addr, 
+-	memcpy(&info->addr, ifaces->next->ifa_addr, 
+-	       ifaces->next->ifa_addr->sa_len);
++
 +#if __linux
-+	       (ifaces->next->ifa_addr->sa_family== AF_INET) ?
-+		sizeof(struct sockaddr_in) : sizeof(struct sockaddr_in6));
++	if (ifaces->next->ifa_addr->sa_family == AF_INET)
++		sa_len = sizeof(struct sockaddr_in);
++	else if (ifaces->next->ifa_addr->sa_family == AF_INET6)
++		sa_len = sizeof(struct sockaddr_in6);
 +#else
- 	       ifaces->next->ifa_addr->sa_len);
++	sa_len = ifaces->next->ifa_addr->sa_len
 +#endif
++	memcpy(&info->addr, ifaces->next->ifa_addr, sa_len);
  	info->flags = ifaces->next->ifa_flags;
  	ifaces->next = ifaces->next->ifa_next;
  	*err = 0;
diff --git a/dhcp.spec b/dhcp.spec
index ea1f708..b023ca9 100644
--- a/dhcp.spec
+++ b/dhcp.spec
@@ -22,7 +22,7 @@
 Summary:  Dynamic host configuration protocol software
 Name:     dhcp
 Version:  4.2.3
-Release:  22.%{patchver}%{?dist}
+Release:  23.%{patchver}%{?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.
@@ -624,6 +624,9 @@ fi
 
 
 %changelog
+* Fri Mar 23 2012 Jiri Popelka <jpopelka at redhat.com> - 12:4.2.3-23.P2
+- improve #449946 fix (#806342)
+
 * Wed Mar 21 2012 Jiri Popelka <jpopelka at redhat.com> - 12:4.2.3-22.P2
 - RFC5970 - DHCPv6 Options for Network Boot (#798735)
 


More information about the scm-commits mailing list