summaryrefslogtreecommitdiff
path: root/sys/net
diff options
context:
space:
mode:
authorMartin Pieuchot <mpi@cvs.openbsd.org>2014-01-16 10:26:22 +0000
committerMartin Pieuchot <mpi@cvs.openbsd.org>2014-01-16 10:26:22 +0000
commitbbc5c8327f17c8fe1b301da8c1cf7621b1e8a73f (patch)
tree0a1ba3ce88a39c6e5666726120db300ebf9410d5 /sys/net
parentc11422932576c88dc3a04307d41fd669f9f95a52 (diff)
Replaces a lookup to find the link-layer address by accessing the if_sadl
member directly. ok mikeb@
Diffstat (limited to 'sys/net')
-rw-r--r--sys/net/if_ethersubr.c21
1 files changed, 6 insertions, 15 deletions
diff --git a/sys/net/if_ethersubr.c b/sys/net/if_ethersubr.c
index 2fefd205ef9..9e4f274fb16 100644
--- a/sys/net/if_ethersubr.c
+++ b/sys/net/if_ethersubr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_ethersubr.c,v 1.159 2013/11/18 20:22:23 deraadt Exp $ */
+/* $OpenBSD: if_ethersubr.c,v 1.160 2014/01/16 10:26:21 mpi Exp $ */
/* $NetBSD: if_ethersubr.c,v 1.19 1996/05/07 02:40:30 thorpej Exp $ */
/*
@@ -491,21 +491,12 @@ ether_input(struct ifnet *ifp0, struct ether_header *eh, struct mbuf *m)
return;
}
if (ETHER_IS_MULTICAST(eh->ether_dhost)) {
+ /*
+ * If this is not a simplex interface, drop the packet
+ * if it came from us.
+ */
if ((ifp->if_flags & IFF_SIMPLEX) == 0) {
- struct ifaddr *ifa;
- struct sockaddr_dl *sdl = NULL;
-
- TAILQ_FOREACH(ifa, &ifp->if_addrlist, ifa_list) {
- if ((sdl =
- (struct sockaddr_dl *)ifa->ifa_addr) &&
- sdl->sdl_family == AF_LINK)
- break;
- }
- /*
- * If this is not a simplex interface, drop the packet
- * if it came from us.
- */
- if (sdl && bcmp(LLADDR(sdl), eh->ether_shost,
+ if (memcmp(LLADDR(ifp->if_sadl), eh->ether_shost,
ETHER_ADDR_LEN) == 0) {
m_freem(m);
return;