summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorMartin Pieuchot <mpi@cvs.openbsd.org>2013-10-28 12:39:43 +0000
committerMartin Pieuchot <mpi@cvs.openbsd.org>2013-10-28 12:39:43 +0000
commit224454b9db239a5794162870ee8fb842802b10a6 (patch)
tree2e81a9e4cb82380bfd2659eb3e3b1a6043475e7f /sys
parent2986acca1de1866152fdd13fab81314b48711e38 (diff)
Do not use the multicast macro IFP_TO_IA() to check if an interface has
a configured IPv4 address but iterates on its private list instead. ok deraadt@
Diffstat (limited to 'sys')
-rw-r--r--sys/net/if_bridge.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/sys/net/if_bridge.c b/sys/net/if_bridge.c
index b6c64b6e6e6..24676cd8634 100644
--- a/sys/net/if_bridge.c
+++ b/sys/net/if_bridge.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_bridge.c,v 1.218 2013/10/17 16:27:40 bluhm Exp $ */
+/* $OpenBSD: if_bridge.c,v 1.219 2013/10/28 12:39:42 mpi Exp $ */
/*
* Copyright (c) 1999, 2000 Jason L. Wright (jason@thought.net)
@@ -58,7 +58,6 @@
#ifdef INET
#include <netinet/in.h>
#include <netinet/in_systm.h>
-#include <netinet/in_var.h>
#include <netinet/ip.h>
#include <netinet/ip_var.h>
#include <netinet/if_ether.h>
@@ -1616,9 +1615,12 @@ bridge_localbroadcast(struct bridge_softc *sc, struct ifnet *ifp,
*/
etype = ntohs(eh->ether_type);
if (!(m->m_flags & M_VLANTAG) && etype == ETHERTYPE_IP) {
- struct in_ifaddr *ia;
- IFP_TO_IA(ifp, ia);
- if (!ia)
+ struct ifaddr *ifa;
+ TAILQ_FOREACH(ifa, &ifp->if_addrlist, ifa_list) {
+ if (ifa->ifa_addr->sa_family == AF_INET)
+ break;
+ }
+ if (ifa == NULL)
return;
}
#endif