diff options
author | Alexander Bluhm <bluhm@cvs.openbsd.org> | 2023-04-07 22:02:59 +0000 |
---|---|---|
committer | Alexander Bluhm <bluhm@cvs.openbsd.org> | 2023-04-07 22:02:59 +0000 |
commit | 39e23352646717ff7a344588aaba5b502fba84ac (patch) | |
tree | aefe56fa7886b920f5e9ad5cfee4ca69a6817591 /sys/netinet/if_ether.c | |
parent | 76cc7ea5f7843a41aa3eeb252823072cc413274c (diff) |
Remove kernel locks from the ARP input path. Caller if_netisr()
grabs the exclusive netlock and that is sufficent for in_arpinput()
and arpcache().
with kn@; OK mvs@; tested by Hrvoje Popovski
Diffstat (limited to 'sys/netinet/if_ether.c')
-rw-r--r-- | sys/netinet/if_ether.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/sys/netinet/if_ether.c b/sys/netinet/if_ether.c index 46aa3c26acb..56146365e5f 100644 --- a/sys/netinet/if_ether.c +++ b/sys/netinet/if_ether.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_ether.c,v 1.260 2023/04/05 21:51:47 bluhm Exp $ */ +/* $OpenBSD: if_ether.c,v 1.261 2023/04/07 22:02:58 bluhm Exp $ */ /* $NetBSD: if_ether.c,v 1.31 1996/05/11 12:59:58 mycroft Exp $ */ /* @@ -609,12 +609,7 @@ in_arpinput(struct ifnet *ifp, struct mbuf *m) "address %s\n", addr, ether_sprintf(ea->arp_sha)); itaddr = isaddr; } else if (rt != NULL) { - int error; - - KERNEL_LOCK(); - error = arpcache(ifp, ea, rt); - KERNEL_UNLOCK(); - if (error) + if (arpcache(ifp, ea, rt)) goto out; } @@ -656,7 +651,7 @@ arpcache(struct ifnet *ifp, struct ether_arp *ea, struct rtentry *rt) time_t uptime; int changed = 0; - KERNEL_ASSERT_LOCKED(); + NET_ASSERT_LOCKED_EXCLUSIVE(); KASSERT(sdl != NULL); /* |