summaryrefslogtreecommitdiffstats
path: root/usr.sbin/arp
diff options
context:
space:
mode:
authorglebius <glebius@FreeBSD.org>2006-10-13 12:38:43 +0000
committerglebius <glebius@FreeBSD.org>2006-10-13 12:38:43 +0000
commit57eda29ce5af8b98ebf438b17af46cfa68ed68e4 (patch)
tree21b856f8f4fdfa3f0aea694f0a28f6d6e44645a4 /usr.sbin/arp
parent533b1fd849eb79c3ae27f0bd6008f722fcfc9c4b (diff)
downloadFreeBSD-src-57eda29ce5af8b98ebf438b17af46cfa68ed68e4.zip
FreeBSD-src-57eda29ce5af8b98ebf438b17af46cfa68ed68e4.tar.gz
- Before doing ioctl(SIOCGIFNETMASK) put the proper IP address into the ifreq,
to obtain correct netmask in case of interface with multiple aliases. - While here, remove a comment with a bad idea. PR: bin/42120 Submitted by: Dmitry Frolov <frolov riss-telecom.ru>
Diffstat (limited to 'usr.sbin/arp')
-rw-r--r--usr.sbin/arp/arp.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/usr.sbin/arp/arp.c b/usr.sbin/arp/arp.c
index b0d8b87..f251243 100644
--- a/usr.sbin/arp/arp.c
+++ b/usr.sbin/arp/arp.c
@@ -761,9 +761,9 @@ get_ether_addr(in_addr_t ipaddr, struct ether_addr *hwaddr)
for (ifr = ifc.ifc_req; ifr < ifend; ifr = NEXTIFR(ifr) ) {
if (ifr->ifr_addr.sa_family != AF_INET)
continue;
- /* XXX can't we use *ifr instead of ifreq ? */
strncpy(ifreq.ifr_name, ifr->ifr_name,
sizeof(ifreq.ifr_name));
+ ifreq.ifr_addr = ifr->ifr_addr;
/*
* Check that the interface is up,
* and not point-to-point or loopback.
OpenPOWER on IntegriCloud