diff options
| author | 2015-09-13 10:42:32 +0000 | |
|---|---|---|
| committer | 2015-09-13 10:42:32 +0000 | |
| commit | 33c2bc4373d6c0568da5de23ba0958438ce92474 (patch) | |
| tree | fc6abeea50df6d61ef5d1e42ef1e18915dfa285c /sys/net/if_ethersubr.c | |
| parent | replace hand rolled refcounts and sleep_setup/finish with refcnts and (diff) | |
| download | wireguard-openbsd-33c2bc4373d6c0568da5de23ba0958438ce92474.tar.xz wireguard-openbsd-33c2bc4373d6c0568da5de23ba0958438ce92474.zip | |
queue revarps to softnet so we can defer processing to a context with
the kernel lock.
"do it" claudio@ mpi@
Diffstat (limited to 'sys/net/if_ethersubr.c')
| -rw-r--r-- | sys/net/if_ethersubr.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/sys/net/if_ethersubr.c b/sys/net/if_ethersubr.c index fc592a3207c..4fbbc548d2e 100644 --- a/sys/net/if_ethersubr.c +++ b/sys/net/if_ethersubr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_ethersubr.c,v 1.224 2015/09/12 13:34:12 mpi Exp $ */ +/* $OpenBSD: if_ethersubr.c,v 1.225 2015/09/13 10:42:32 dlg Exp $ */ /* $NetBSD: if_ethersubr.c,v 1.19 1996/05/07 02:40:30 thorpej Exp $ */ /* @@ -296,6 +296,7 @@ ether_input(struct ifnet *ifp, struct mbuf *m, void *cookie) struct ether_header *eh_tmp; #endif + ac = (struct arpcom *)ifp; eh = mtod(m, struct ether_header *); m_adj(m, ETHER_HDR_LEN); @@ -305,7 +306,7 @@ ether_input(struct ifnet *ifp, struct mbuf *m, void *cookie) * if it came from us. */ if ((ifp->if_flags & IFF_SIMPLEX) == 0) { - if (memcmp(LLADDR(ifp->if_sadl), eh->ether_shost, + if (memcmp(ac->ac_enaddr, eh->ether_shost, ETHER_ADDR_LEN) == 0) { m_freem(m); return (1); @@ -320,10 +321,6 @@ ether_input(struct ifnet *ifp, struct mbuf *m, void *cookie) ifp->if_imcasts++; } - etype = ntohs(eh->ether_type); - - ac = (struct arpcom *)ifp; - /* * If packet has been filtered by the bpf listener, drop it now * also HW vlan tagged packets that were not collected by vlan(4) @@ -346,6 +343,8 @@ ether_input(struct ifnet *ifp, struct mbuf *m, void *cookie) } } + etype = ntohs(eh->ether_type); + decapsulate: switch (etype) { case ETHERTYPE_IP: @@ -361,7 +360,7 @@ decapsulate: case ETHERTYPE_REVARP: if (ifp->if_flags & IFF_NOARP) goto dropanyway; - revarpinput(m); /* XXX queue? */ + inq = &rarpintrq; return (1); #ifdef INET6 |
