This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

net bridge aging


Hi,

The aging process of the network bridging code takes twice the time specified to
age out an unused entry, due to the fact that an entry requires *two* executions
of the bridge_rtage() routine to actually get removed.

The patch below proposes a solution to this problem; it also defines
BRIDGE_RTABLE_TIMEOUT as 300s that, if I remember correctly, the standard
specifies as default aging time.

Robin


<patch>
Index: packages/net/tcpip/current/src/sys/net/if_bridge.c
===================================================================
RCS file: /usr/cvs/eCos/packages/net/net/tcpip/current/src/sys/net/if_bridge.c,v
retrieving revision 1.3
diff -u -r1.3 if_bridge.c
--- packages/net/tcpip/current/src/sys/net/if_bridge.c	2001/03/14 14:13:06	1.3
+++ packages/net/tcpip/current/src/sys/net/if_bridge.c	2001/05/07 15:50:57
@@ -156,7 +156,7 @@
  * Timeout (in seconds) for entries learned dynamically
  */
 #ifndef BRIDGE_RTABLE_TIMEOUT
-#define BRIDGE_RTABLE_TIMEOUT	240
+#define BRIDGE_RTABLE_TIMEOUT	300
 #endif
 
 extern int ifqmaxlen;
@@ -269,7 +269,7 @@
 
 	for (i = 0; i < CYGNUM_NET_BRIDGES; i++) {
 		bridgectl[i].sc_brtmax = BRIDGE_RTABLE_MAX;
-		bridgectl[i].sc_brttimeout = BRIDGE_RTABLE_TIMEOUT;
+		bridgectl[i].sc_brttimeout = (BRIDGE_RTABLE_TIMEOUT * hz) / 2;
 		LIST_INIT(&bridgectl[i].sc_iflist);
 		ifp = &bridgectl[i].sc_if;
 		sprintf(ifp->if_xname, "bridge%d", i);
@@ -529,13 +529,13 @@
 		if ((error = suser(prc->p_ucred, &prc->p_acflag)) != 0)
 			break;
 #endif
-		sc->sc_brttimeout = bcacheto->ifbct_time;
+		sc->sc_brttimeout = (bcacheto->ifbct_time * hz) / 2;
 		untimeout(bridge_rtage, sc);
 		if (bcacheto->ifbct_time != 0)
 			timeout(bridge_rtage, sc, sc->sc_brttimeout);
 		break;
 	case SIOCBRDGGTO:
-		bcacheto->ifbct_time = sc->sc_brttimeout;
+		bcacheto->ifbct_time = (2 * sc->sc_brttimeout) / hz;
 		break;
 	case SIOCSIFFLAGS:
 		if ((ifp->if_flags & IFF_UP) == IFF_UP)
@@ -798,7 +798,7 @@
 	splx(s);
 
 	if (sc->sc_brttimeout != 0)
-		timeout(bridge_rtage, sc, sc->sc_brttimeout * hz);
+		timeout(bridge_rtage, sc, sc->sc_brttimeout);
 }
 
 /*
@@ -1569,7 +1569,7 @@
 	splx(s);
 
 	if (sc->sc_brttimeout != 0)
-		timeout(bridge_rtage, sc, sc->sc_brttimeout * hz);
+		timeout(bridge_rtage, sc, sc->sc_brttimeout);
 }
 
 /*
</patch>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]