diff options
author | Niklas Hallqvist <niklas@cvs.openbsd.org> | 1999-08-08 02:43:00 +0000 |
---|---|---|
committer | Niklas Hallqvist <niklas@cvs.openbsd.org> | 1999-08-08 02:43:00 +0000 |
commit | 277edc6d8c2f870654d25fc8b95348753eceb020 (patch) | |
tree | 4a364815fee8afdf4593da6004c32c868a500e13 /sys | |
parent | 456c30529286b2c869ca3a9ea646e456b34b7499 (diff) |
Fix cases when wanting to communicate with the bridge'
s remote interfaces, both ARP and local delivery had bugs
Diffstat (limited to 'sys')
-rw-r--r-- | sys/net/if_bridge.c | 6 | ||||
-rw-r--r-- | sys/net/if_bridge.h | 4 | ||||
-rw-r--r-- | sys/net/if_ethersubr.c | 8 | ||||
-rw-r--r-- | sys/netinet/if_ether.c | 6 |
4 files changed, 14 insertions, 10 deletions
diff --git a/sys/net/if_bridge.c b/sys/net/if_bridge.c index 1a870eddb45..03a6962cdc1 100644 --- a/sys/net/if_bridge.c +++ b/sys/net/if_bridge.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_bridge.c,v 1.13 1999/08/08 00:43:00 niklas Exp $ */ +/* $OpenBSD: if_bridge.c,v 1.14 1999/08/08 02:42:58 niklas Exp $ */ /* * Copyright (c) 1999 Jason L. Wright (jason@thought.net) @@ -860,10 +860,11 @@ bridgeintr(void) * bridge members. */ struct mbuf * -bridge_input(ifp, eh, m) +bridge_input(ifp, eh, m, forme) struct ifnet *ifp; struct ether_header *eh; struct mbuf *m; + int *forme; { struct bridge_softc *sc; int s; @@ -912,6 +913,7 @@ bridge_input(ifp, eh, m) ac = (struct arpcom *)ifl->ifp; if (bcmp(ac->ac_enaddr, eh->ether_dhost, ETHER_ADDR_LEN) == 0) { + *forme = 1; return (m); } ifl = LIST_NEXT(ifl, next); diff --git a/sys/net/if_bridge.h b/sys/net/if_bridge.h index 227aca32b4f..ee193e94dff 100644 --- a/sys/net/if_bridge.h +++ b/sys/net/if_bridge.h @@ -1,4 +1,4 @@ -/* $OpenBSD: if_bridge.h,v 1.7 1999/08/08 00:43:00 niklas Exp $ */ +/* $OpenBSD: if_bridge.h,v 1.8 1999/08/08 02:42:58 niklas Exp $ */ /* * Copyright (c) 1999 Jason L. Wright (jason@thought.net) @@ -103,7 +103,7 @@ struct ifbcachetoreq { #ifdef _KERNEL void bridge_ifdetach __P((struct ifnet *)); struct mbuf *bridge_input __P((struct ifnet *, struct ether_header *, - struct mbuf *)); + struct mbuf *, int *)); int bridge_output __P((struct ifnet *, struct mbuf *, struct sockaddr *, struct rtentry *rt)); #endif /* _KERNEL */ diff --git a/sys/net/if_ethersubr.c b/sys/net/if_ethersubr.c index 78ecef3d472..088923828a4 100644 --- a/sys/net/if_ethersubr.c +++ b/sys/net/if_ethersubr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_ethersubr.c,v 1.29 1999/08/08 00:43:00 niklas Exp $ */ +/* $OpenBSD: if_ethersubr.c,v 1.30 1999/08/08 02:42:58 niklas Exp $ */ /* $NetBSD: if_ethersubr.c,v 1.19 1996/05/07 02:40:30 thorpej Exp $ */ /* @@ -506,7 +506,7 @@ ether_input(ifp, eh, m) { register struct ifqueue *inq; u_int16_t etype; - int s, llcfound = 0; + int s, llcfound = 0, forme = 0; register struct llc *l; struct arpcom *ac = (struct arpcom *)ifp; @@ -534,7 +534,7 @@ ether_input(ifp, eh, m) * gets processed as normal. */ if (ifp->if_bridge) { - m = bridge_input(ifp, eh, m); + m = bridge_input(ifp, eh, m, &forme); if (m == NULL) return; } @@ -543,7 +543,7 @@ ether_input(ifp, eh, m) * If packet is unicast and we're in promiscuous mode, make sure it * is for us. Drop otherwise. */ - if ((m->m_flags & (M_BCAST|M_MCAST)) == 0 && + if (!forme && (m->m_flags & (M_BCAST|M_MCAST)) == 0 && (ifp->if_flags & IFF_PROMISC)) { if (bcmp(ac->ac_enaddr, (caddr_t)eh->ether_dhost, ETHER_ADDR_LEN)) { diff --git a/sys/netinet/if_ether.c b/sys/netinet/if_ether.c index 3cf783738a4..a699cbf0fab 100644 --- a/sys/netinet/if_ether.c +++ b/sys/netinet/if_ether.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_ether.c,v 1.17 1999/08/08 00:43:00 niklas Exp $ */ +/* $OpenBSD: if_ether.c,v 1.18 1999/08/08 02:42:59 niklas Exp $ */ /* $NetBSD: if_ether.c,v 1.31 1996/05/11 12:59:58 mycroft Exp $ */ /* @@ -464,7 +464,9 @@ in_arpinput(m) bcopy((caddr_t)ea->arp_spa, (caddr_t)&isaddr, sizeof (isaddr)); bcopy((caddr_t)ea->arp_tpa, (caddr_t)&itaddr, sizeof (itaddr)); for (ia = in_ifaddr.tqh_first; ia != 0; ia = ia->ia_list.tqe_next) - if (ia->ia_ifp == &ac->ac_if) { + if (ia->ia_ifp == &ac->ac_if || + (ia->ia_ifp->if_bridge && + ia->ia_ifp->if_bridge == ac->ac_if.if_bridge)) { maybe_ia = ia; if (itaddr.s_addr == ia->ia_addr.sin_addr.s_addr || isaddr.s_addr == ia->ia_addr.sin_addr.s_addr) |