Fixed brokenness of patch-ad

Ok'ed during freeze by wiz@
This commit is contained in:
pettai 2010-03-27 13:37:33 +00:00
parent beca9188a3
commit b994b716a2
2 changed files with 4 additions and 4 deletions

View file

@ -1,4 +1,4 @@
$NetBSD: distinfo,v 1.41 2010/03/21 21:58:23 pettai Exp $
$NetBSD: distinfo,v 1.42 2010/03/27 13:37:33 pettai Exp $
SHA1 (nmap-5.21.tar.bz2) = ce5ff792161dae0037e41b31e0c2ef683ce94655
RMD160 (nmap-5.21.tar.bz2) = 85e912c3c6a7ed03eb1b399c812836071e4dcf9f
@ -6,5 +6,5 @@ Size (nmap-5.21.tar.bz2) = 10015121 bytes
SHA1 (patch-aa) = 61593e0479a79bcb4cce2e88b2e5753fa14bc429
SHA1 (patch-ab) = 22c377e9a340a6e6d7b9a36b63e6ffc47a084b3b
SHA1 (patch-ac) = c22e8f6411b1152a6e7582c90e5ec5bd4c6acaad
SHA1 (patch-ad) = 607225d4f0d1e9a7ea5f73aee79e71c6995f1c64
SHA1 (patch-ad) = 9ce85af817e3d057b461316b2b2b526e6373a82b
SHA1 (patch-aj) = 868440ce24a70c1a747af6d65eed24f20c4bb892

View file

@ -1,4 +1,4 @@
$NetBSD: patch-ad,v 1.14 2010/03/21 21:58:23 pettai Exp $
$NetBSD: patch-ad,v 1.15 2010/03/27 13:37:34 pettai Exp $
Correct handling of the length of data returned by SIOCGIFCONF. The
actual length of each item is never less than sizeof(struct ifreq), but
@ -40,7 +40,7 @@ had two problems:
+ data extends beyond the end of ifr_ifru. */
len = sizeof(struct ifreq);
+#if HAVE_SOCKADDR_SA_LEN
+ len = ifr->ifr_addr.sa_len > sizeof(ifr->ifr_name);
+ if (ifr->ifr_addr.sa_len > sizeof(ifr->ifr_ifru))
+ len += (ifr->ifr_addr.sa_len - sizeof(ifr->ifr_ifru));
#endif