summaryrefslogtreecommitdiff
path: root/sys/net/if_bridge.c
diff options
context:
space:
mode:
authorReyk Floeter <reyk@cvs.openbsd.org>2005-10-09 19:44:23 +0000
committerReyk Floeter <reyk@cvs.openbsd.org>2005-10-09 19:44:23 +0000
commit4ceabd5ebb41f8cdb18b7d287bc05eb2e7869616 (patch)
tree584e400fdcd01704067e977d3f7d1443246ae576 /sys/net/if_bridge.c
parent74b417e51569cd7081db227132f312f06a31f2ef (diff)
if the wireless hostap interface belongs to a bridge, learn the node's
address dynamically on this interface after successful association. this could speed wireless roaming to openbsd accesspoints. ok jason@, jsg@ can't see anything obectionable
Diffstat (limited to 'sys/net/if_bridge.c')
-rw-r--r--sys/net/if_bridge.c41
1 files changed, 40 insertions, 1 deletions
diff --git a/sys/net/if_bridge.c b/sys/net/if_bridge.c
index 7510ec5842c..ef434bc4e05 100644
--- a/sys/net/if_bridge.c
+++ b/sys/net/if_bridge.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_bridge.c,v 1.145 2005/07/31 03:30:55 pascoe Exp $ */
+/* $OpenBSD: if_bridge.c,v 1.146 2005/10/09 19:44:22 reyk Exp $ */
/*
* Copyright (c) 1999, 2000 Jason L. Wright (jason@thought.net)
@@ -715,6 +715,45 @@ bridge_ifdetach(struct ifnet *ifp)
}
}
+void
+bridge_update(struct ifnet *ifp, struct ether_addr *ea, int delete)
+{
+ struct bridge_softc *sc = (struct bridge_softc *)ifp->if_bridge;
+ struct bridge_iflist *bif;
+ u_int8_t *addr;
+
+ addr = (u_int8_t *)ea;
+
+ LIST_FOREACH(bif, &sc->sc_iflist, next)
+ if (bif->ifp == ifp) {
+ /*
+ * Update the bridge interface if it is in
+ * the learning state.
+ */
+ if ((bif->bif_flags & IFBIF_LEARNING) &&
+ (ETHER_IS_MULTICAST(addr) == 0) &&
+ !(addr[0] == 0 && addr[1] == 0 && addr[2] == 0 &&
+ addr[3] == 0 && addr[4] == 0 && addr[5] == 0)) {
+ /* Care must be taken with spanning tree */
+ if ((bif->bif_flags & IFBIF_STP) &&
+ (bif->bif_state == BSTP_IFSTATE_BLOCKING ||
+ bif->bif_state == BSTP_IFSTATE_LISTENING ||
+ bif->bif_state == BSTP_IFSTATE_DISABLED))
+ return;
+
+ /* Delete the address from the bridge */
+ bridge_rtdaddr(sc, ea);
+
+ if (!delete) {
+ /* Update the bridge table */
+ bridge_rtupdate(sc, ea, ifp, 0,
+ IFBAF_DYNAMIC);
+ }
+ }
+ return;
+ }
+}
+
int
bridge_bifconf(struct bridge_softc *sc, struct ifbifconf *bifc)
{