diff options
author | qingli <qingli@FreeBSD.org> | 2008-12-23 03:33:32 +0000 |
---|---|---|
committer | qingli <qingli@FreeBSD.org> | 2008-12-23 03:33:32 +0000 |
commit | 95b2457edfed9c954582bdeac5fbb5c317f21e76 (patch) | |
tree | 76b8a8e3931c07fa53a7afd16b74fa0a9d2bd467 /sys/netinet/if_ether.c | |
parent | 87e5b5b6cc6762da9f114d35ecf216749cf3326a (diff) | |
download | FreeBSD-src-95b2457edfed9c954582bdeac5fbb5c317f21e76.zip FreeBSD-src-95b2457edfed9c954582bdeac5fbb5c317f21e76.tar.gz |
Don't create a bogus ARP entry for 0.0.0.0.
Diffstat (limited to 'sys/netinet/if_ether.c')
-rw-r--r-- | sys/netinet/if_ether.c | 31 |
1 files changed, 16 insertions, 15 deletions
diff --git a/sys/netinet/if_ether.c b/sys/netinet/if_ether.c index 1b03fb3..31a13c9 100644 --- a/sys/netinet/if_ether.c +++ b/sys/netinet/if_ether.c @@ -758,23 +758,24 @@ arp_ifinit(struct ifnet *ifp, struct ifaddr *ifa) { struct llentry *lle; - if (ntohl(IA_SIN(ifa)->sin_addr.s_addr) != INADDR_ANY) + if (ntohl(IA_SIN(ifa)->sin_addr.s_addr) != INADDR_ANY) { arprequest(ifp, &IA_SIN(ifa)->sin_addr, &IA_SIN(ifa)->sin_addr, IF_LLADDR(ifp)); - /* - * interface address is considered static entry - * because the output of the arp utility shows - * that L2 entry as permanent - */ - IF_AFDATA_LOCK(ifp); - lle = lla_lookup(LLTABLE(ifp), (LLE_CREATE | LLE_IFADDR | LLE_STATIC), - (struct sockaddr *)IA_SIN(ifa)); - IF_AFDATA_UNLOCK(ifp); - if (lle == NULL) - log(LOG_INFO, "arp_ifinit: cannot create arp " - "entry for interface address\n"); - else - LLE_RUNLOCK(lle); + /* + * interface address is considered static entry + * because the output of the arp utility shows + * that L2 entry as permanent + */ + IF_AFDATA_LOCK(ifp); + lle = lla_lookup(LLTABLE(ifp), (LLE_CREATE | LLE_IFADDR | LLE_STATIC), + (struct sockaddr *)IA_SIN(ifa)); + IF_AFDATA_UNLOCK(ifp); + if (lle == NULL) + log(LOG_INFO, "arp_ifinit: cannot create arp " + "entry for interface address\n"); + else + LLE_RUNLOCK(lle); + } ifa->ifa_rtrequest = NULL; } |