summaryrefslogtreecommitdiffstats
path: root/sys/netinet/if_ether.c
diff options
context:
space:
mode:
authorjlemon <jlemon@FreeBSD.org>2001-10-20 05:14:06 +0000
committerjlemon <jlemon@FreeBSD.org>2001-10-20 05:14:06 +0000
commita3a164e4889e163e72fdfc08e59d36d53179e7f9 (patch)
tree2cca2d1151cbf5756f168a155e3737076001fdd3 /sys/netinet/if_ether.c
parentea763822015c6970f3242275e2d00ef8b8730411 (diff)
downloadFreeBSD-src-a3a164e4889e163e72fdfc08e59d36d53179e7f9.zip
FreeBSD-src-a3a164e4889e163e72fdfc08e59d36d53179e7f9.tar.gz
Only examine inet addresses of the interface. This was broken in r1.83,
with the result that the system would reply to an ARP request of 0.0.0.0
Diffstat (limited to 'sys/netinet/if_ether.c')
-rw-r--r--sys/netinet/if_ether.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/netinet/if_ether.c b/sys/netinet/if_ether.c
index 1b654f4..ba6b352 100644
--- a/sys/netinet/if_ether.c
+++ b/sys/netinet/if_ether.c
@@ -593,10 +593,12 @@ in_arpinput(m)
isaddr.s_addr == ia->ia_addr.sin_addr.s_addr)
goto match;
/*
- * No match, use the first address on the receive interface
+ * No match, use the first inet address on the receive interface
* as a dummy address for the rest of the function.
*/
- ifa = TAILQ_FIRST(&ifp->if_addrhead);
+ TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link)
+ if (ifa->ifa_addr && ifa->ifa_addr->sa_family == AF_INET)
+ break;
if (ifa == NULL) {
m_freem(m);
return;
OpenPOWER on IntegriCloud