diff options
author | Michael Shalayeff <mickey@cvs.openbsd.org> | 2001-02-06 06:48:09 +0000 |
---|---|---|
committer | Michael Shalayeff <mickey@cvs.openbsd.org> | 2001-02-06 06:48:09 +0000 |
commit | 56eb68e7d8ece0c90a64268c466b6e7b012c7115 (patch) | |
tree | 8f06fb4aee4531b8458b03f4abd8719966819009 /sys | |
parent | 487517edbe7e6e8e75221be9ff1af34ac23acb14 (diff) |
allow for configuring number of bridge ifaces in ukc; jason@ ok and help
Diffstat (limited to 'sys')
-rw-r--r-- | sys/net/if_bridge.c | 29 |
1 files changed, 14 insertions, 15 deletions
diff --git a/sys/net/if_bridge.c b/sys/net/if_bridge.c index f21a10a6141..8b2eba659ad 100644 --- a/sys/net/if_bridge.c +++ b/sys/net/if_bridge.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_bridge.c,v 1.49 2001/02/04 18:10:10 jason Exp $ */ +/* $OpenBSD: if_bridge.c,v 1.50 2001/02/06 06:48:08 mickey Exp $ */ /* * Copyright (c) 1999, 2000 Jason L. Wright (jason@thought.net) @@ -31,12 +31,9 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#include "bridge.h" #include "bpfilter.h" #include "gif.h" -#if NBRIDGE > 0 - #include <sys/param.h> #include <sys/proc.h> #include <sys/systm.h> @@ -105,7 +102,8 @@ extern int ifqmaxlen; -struct bridge_softc bridgectl[NBRIDGE]; +struct bridge_softc *bridgectl; +int nbridge; void bridgeattach __P((int)); int bridge_ioctl __P((struct ifnet *, u_long, caddr_t)); @@ -152,16 +150,19 @@ struct mbuf *bridge_filter __P((struct bridge_softc *, struct ifnet *, #endif void -bridgeattach(unused) - int unused; +bridgeattach(n) + int n; { - int i; + struct bridge_softc *sc; struct ifnet *ifp; + int i; - for (i = 0; i < NBRIDGE; i++) { - struct bridge_softc *sc; - - sc = &bridgectl[i]; + bridgectl = malloc(n * sizeof(*sc), M_DEVBUF, M_NOWAIT); + if (!bridgectl) + return; + nbridge = n; + bzero(bridgectl, n * sizeof(*sc)); + for (sc = bridgectl, i = 0; i < nbridge; i++, sc++) { sc->sc_brtmax = BRIDGE_RTABLE_MAX; sc->sc_brttimeout = BRIDGE_RTABLE_TIMEOUT; @@ -869,7 +870,7 @@ bridgeintr(void) struct mbuf *m; int i, s; - for (i = 0; i < NBRIDGE; i++) { + for (i = 0; i < nbridge; i++) { sc = &bridgectl[i]; for (;;) { s = splimp(); @@ -1984,5 +1985,3 @@ dropit: return (NULL); } #endif - -#endif /* NBRIDGE */ |