-/* $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 $ */
/*
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;