diff options
author | Camiel Dobbelaar <camield@cvs.openbsd.org> | 2012-10-06 18:44:48 +0000 |
---|---|---|
committer | Camiel Dobbelaar <camield@cvs.openbsd.org> | 2012-10-06 18:44:48 +0000 |
commit | 5450bca64dfcae9ec2d8fe7b1f0f2c2f6b29991b (patch) | |
tree | 88498bab5babd72ba252eb20b77a4b08c32fc486 /sys/net/if_bridge.c | |
parent | 4e71e6371496c056d57456b55215b7c4033a82f6 (diff) |
Remove bridge_rttrim(). It's only triggered in the unlikely event that the
routecache is full and the admin is making it smaller. It then does a
lame attempt at shrinking the routecache, something that a flush or flushall
can do better.
ok henning beck
Diffstat (limited to 'sys/net/if_bridge.c')
-rw-r--r-- | sys/net/if_bridge.c | 44 |
1 files changed, 1 insertions, 43 deletions
diff --git a/sys/net/if_bridge.c b/sys/net/if_bridge.c index 72e244b9f48..d62ba1b4712 100644 --- a/sys/net/if_bridge.c +++ b/sys/net/if_bridge.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_bridge.c,v 1.197 2012/10/05 17:17:04 camield Exp $ */ +/* $OpenBSD: if_bridge.c,v 1.198 2012/10/06 18:44:47 camield Exp $ */ /* * Copyright (c) 1999, 2000 Jason L. Wright (jason@thought.net) @@ -132,7 +132,6 @@ int bridge_bifconf(struct bridge_softc *, struct ifbifconf *); void bridge_timer(void *); int bridge_rtfind(struct bridge_softc *, struct ifbaconf *); void bridge_rtage(struct bridge_softc *); -void bridge_rttrim(struct bridge_softc *); int bridge_rtdaddr(struct bridge_softc *, struct ether_addr *); int bridge_rtflush(struct bridge_softc *, int); struct ifnet * bridge_rtupdate(struct bridge_softc *, @@ -567,7 +566,6 @@ bridge_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) if ((error = suser(curproc, 0)) != 0) break; sc->sc_brtmax = bparam->ifbrp_csize; - bridge_rttrim(sc); break; case SIOCBRDGSTO: if ((error = suser(curproc, 0)) != 0) @@ -1849,46 +1847,6 @@ bridge_hash(struct bridge_softc *sc, struct ether_addr *addr) return (c & BRIDGE_RTABLE_MASK); } -/* - * Trim the routing table so that we've got a number of routes - * less than or equal to the maximum. - */ -void -bridge_rttrim(struct bridge_softc *sc) -{ - struct bridge_rtnode *n, *p; - int i; - - /* - * Make sure we have to trim the address table - */ - if (sc->sc_brtcnt <= sc->sc_brtmax) - return; - - /* - * Force an aging cycle, this might trim enough addresses. - */ - bridge_rtage(sc); - - if (sc->sc_brtcnt <= sc->sc_brtmax) - return; - - for (i = 0; i < BRIDGE_RTABLE_SIZE; i++) { - n = LIST_FIRST(&sc->sc_rts[i]); - while (n != LIST_END(&sc->sc_rts[i])) { - p = LIST_NEXT(n, brt_next); - if ((n->brt_flags & IFBAF_TYPEMASK) == IFBAF_DYNAMIC) { - LIST_REMOVE(n, brt_next); - sc->sc_brtcnt--; - free(n, M_DEVBUF); - if (sc->sc_brtcnt <= sc->sc_brtmax) - return; - } - n = p; - } - } -} - void bridge_timer(void *vsc) { |