diff options
author | Alexander Bluhm <bluhm@cvs.openbsd.org> | 2023-05-12 12:40:50 +0000 |
---|---|---|
committer | Alexander Bluhm <bluhm@cvs.openbsd.org> | 2023-05-12 12:40:50 +0000 |
commit | c235e8e2a6cabe338b8e9270de8a19910211cc2e (patch) | |
tree | eaaccf6222346f723027fa77ab960bca3f2bfae0 /sys/netinet/if_ether.c | |
parent | 283f05c3fc3f269735d6a3547aa9ca23f20d344a (diff) |
Access rt_llinfo without checking RTF_LLINFO flag before. They are
always set together with ARP mutex.
OK mvs@
Diffstat (limited to 'sys/netinet/if_ether.c')
-rw-r--r-- | sys/netinet/if_ether.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/sys/netinet/if_ether.c b/sys/netinet/if_ether.c index fbf811349c2..2854dd0c2dd 100644 --- a/sys/netinet/if_ether.c +++ b/sys/netinet/if_ether.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_ether.c,v 1.264 2023/05/07 16:23:23 bluhm Exp $ */ +/* $OpenBSD: if_ether.c,v 1.265 2023/05/12 12:40:49 bluhm Exp $ */ /* $NetBSD: if_ether.c,v 1.31 1996/05/11 12:59:58 mycroft Exp $ */ /* @@ -388,10 +388,8 @@ arpresolve(struct ifnet *ifp, struct rtentry *rt0, struct mbuf *m, rt->rt_expire - arpt_keep / 8 < uptime) { mtx_enter(&arp_mtx); - if (ISSET(rt->rt_flags, RTF_LLINFO)) { - la = (struct llinfo_arp *)rt->rt_llinfo; - KASSERT(la != NULL); - + la = (struct llinfo_arp *)rt->rt_llinfo; + if (la != NULL) { if (la->la_refreshed + 30 < uptime) { la->la_refreshed = uptime; refresh = 1; @@ -412,12 +410,11 @@ arpresolve(struct ifnet *ifp, struct rtentry *rt0, struct mbuf *m, goto bad; mtx_enter(&arp_mtx); - if (!ISSET(rt->rt_flags, RTF_LLINFO)) { + la = (struct llinfo_arp *)rt->rt_llinfo; + if (la == NULL) { mtx_leave(&arp_mtx); goto bad; } - la = (struct llinfo_arp *)rt->rt_llinfo; - KASSERT(la != NULL); /* * There is an arptab entry, but no ethernet address |