diff options
Diffstat (limited to 'sys/net/if_ethersubr.c')
-rw-r--r-- | sys/net/if_ethersubr.c | 21 |
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; |