This is the mail archive of the glibc-cvs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

GNU C Library master sources branch master updated. glibc-2.21-416-g2483fa8


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".

The branch, master has been updated
       via  2483fa850f86a2edec705aaeb2ca84414d6e1367 (commit)
      from  fd57d826c62c8eaaedcda49a1367b6604db775f7 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=2483fa850f86a2edec705aaeb2ca84414d6e1367

commit 2483fa850f86a2edec705aaeb2ca84414d6e1367
Author: Steve Ellcey <sellcey@mips.com>
Date:   Mon Jun 1 09:00:05 2015 -0700

    	* resolv/res_hconf.c (_res_hconf_reorder_addrs): Use a union to
    	copy data from cur_ifr->ifr_addr and cur_ifr->ifr_netmask.

diff --git a/ChangeLog b/ChangeLog
index 77429f7..f2d0cac 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2015-06-01  Steve Ellcey  <sellcey@imgtec.com>
+
+	* resolv/res_hconf.c (_res_hconf_reorder_addrs): Use a union to
+	copy data from cur_ifr->ifr_addr and cur_ifr->ifr_netmask.
+
 2015-05-29  Adhemerval Zanella  <adhemerval.zanella@linaro.org>
 
 	* sysdeps/powerpc/fpu/libm-test-ulps: Update.
diff --git a/resolv/res_hconf.c b/resolv/res_hconf.c
index 73942e8..b9c229d 100644
--- a/resolv/res_hconf.c
+++ b/resolv/res_hconf.c
@@ -439,18 +439,24 @@ _res_hconf_reorder_addrs (struct hostent *hp)
 	  for (cur_ifr = ifr, i = 0; i < num;
 	       cur_ifr = __if_nextreq (cur_ifr), ++i)
 	    {
+	      union
+	      {
+		struct sockaddr sa;
+		struct sockaddr_in sin;
+	      } ss;
+
 	      if (cur_ifr->ifr_addr.sa_family != AF_INET)
 		continue;
 
 	      ifaddrs[new_num_ifs].addrtype = AF_INET;
-	      ifaddrs[new_num_ifs].u.ipv4.addr =
-		((struct sockaddr_in *) &cur_ifr->ifr_addr)->sin_addr.s_addr;
+	      ss.sa = cur_ifr->ifr_addr;
+	      ifaddrs[new_num_ifs].u.ipv4.addr = ss.sin.sin_addr.s_addr;
 
 	      if (__ioctl (sd, SIOCGIFNETMASK, cur_ifr) < 0)
 		continue;
 
-	      ifaddrs[new_num_ifs].u.ipv4.mask =
-		((struct sockaddr_in *) &cur_ifr->ifr_netmask)->sin_addr.s_addr;
+	      ss.sa = cur_ifr->ifr_netmask;
+	      ifaddrs[new_num_ifs].u.ipv4.mask = ss.sin.sin_addr.s_addr;
 
 	      /* Now we're committed to this entry.  */
 	      ++new_num_ifs;

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog          |    5 +++++
 resolv/res_hconf.c |   14 ++++++++++----
 2 files changed, 15 insertions(+), 4 deletions(-)


hooks/post-receive
-- 
GNU C Library master sources


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]