aboutsummaryrefslogtreecommitdiff
path: root/sys/netinet
diff options
context:
space:
mode:
authorKip Macy <kmacy@FreeBSD.org>2008-12-17 00:14:28 +0000
committerKip Macy <kmacy@FreeBSD.org>2008-12-17 00:14:28 +0000
commit00a46b31223307feebc229fd89b36fe4b9ca5847 (patch)
tree30a2eb0e65c56dff16392c86287d78e922b6e20e /sys/netinet
parent991f8615e4afee6de0771dc9fe55e4074a04cfe9 (diff)
Notes
Diffstat (limited to 'sys/netinet')
-rw-r--r--sys/netinet/if_ether.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/sys/netinet/if_ether.c b/sys/netinet/if_ether.c
index b50e1d9f35d2..7bea5aa402d6 100644
--- a/sys/netinet/if_ether.c
+++ b/sys/netinet/if_ether.c
@@ -251,7 +251,7 @@ arpresolve(struct ifnet *ifp, struct rtentry *rt0, struct mbuf *m,
{
INIT_VNET_INET(ifp->if_vnet);
struct llentry *la = 0;
- u_int flags;
+ u_int flags = 0;
int error, renew;
*lle = NULL;
@@ -268,18 +268,19 @@ arpresolve(struct ifnet *ifp, struct rtentry *rt0, struct mbuf *m,
return (0);
}
}
-
- flags = (ifp->if_flags & (IFF_NOARP | IFF_STATICARP)) ? 0 : LLE_CREATE;
-
/* XXXXX
- * Since this function returns an llentry, the
- * lock is held by the caller.
- * XXX if caller is required to hold lock, assert it
*/
retry:
- IF_AFDATA_LOCK(ifp);
+ IF_AFDATA_RLOCK(ifp);
la = lla_lookup(LLTABLE(ifp), flags, dst);
- IF_AFDATA_UNLOCK(ifp);
+ IF_AFDATA_RUNLOCK(ifp);
+ if ((la == NULL) && ((flags & LLE_EXCLUSIVE) == 0)
+ && ((ifp->if_flags & (IFF_NOARP | IFF_STATICARP)) == 0)) {
+ flags |= (LLE_CREATE | LLE_EXCLUSIVE);
+ IF_AFDATA_WLOCK(ifp);
+ la = lla_lookup(LLTABLE(ifp), flags, dst);
+ IF_AFDATA_WUNLOCK(ifp);
+ }
if (la == NULL) {
if (flags & LLE_CREATE)
log(LOG_DEBUG,