From 28b37041d3db0572a5c669f3c06191bf10a4ecad Mon Sep 17 00:00:00 2001 From: thompsa Date: Mon, 2 Jan 2006 22:23:03 +0000 Subject: It is better to use time_uptime here since it is monotonic. Pointed out by: glebius --- sys/net/if_bridge.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'sys') diff --git a/sys/net/if_bridge.c b/sys/net/if_bridge.c index d8cafe9..08ce4b7 100644 --- a/sys/net/if_bridge.c +++ b/sys/net/if_bridge.c @@ -1037,8 +1037,8 @@ bridge_ioctl_rts(struct bridge_softc *sc, void *arg) sizeof(bareq.ifba_ifsname)); memcpy(bareq.ifba_dst, brt->brt_addr, sizeof(brt->brt_addr)); if ((brt->brt_flags & IFBAF_TYPEMASK) == IFBAF_DYNAMIC && - time_second < brt->brt_expire) - bareq.ifba_expire = brt->brt_expire - time_second; + time_uptime < brt->brt_expire) + bareq.ifba_expire = brt->brt_expire - time_uptime; else bareq.ifba_expire = 0; bareq.ifba_flags = brt->brt_flags; @@ -2141,7 +2141,7 @@ bridge_rtupdate(struct bridge_softc *sc, const uint8_t *dst, if (brt == NULL) return (ENOMEM); - brt->brt_expire = time_second + sc->sc_brttimeout; + brt->brt_expire = time_uptime + sc->sc_brttimeout; brt->brt_flags = IFBAF_DYNAMIC; memcpy(brt->brt_addr, dst, ETHER_ADDR_LEN); @@ -2155,7 +2155,7 @@ bridge_rtupdate(struct bridge_softc *sc, const uint8_t *dst, if (setflags) { brt->brt_flags = flags; brt->brt_expire = (flags & IFBAF_STATIC) ? 0 : - time_second + sc->sc_brttimeout; + time_uptime + sc->sc_brttimeout; } return (0); @@ -2246,7 +2246,7 @@ bridge_rtage(struct bridge_softc *sc) for (brt = LIST_FIRST(&sc->sc_rtlist); brt != NULL; brt = nbrt) { nbrt = LIST_NEXT(brt, brt_list); if ((brt->brt_flags & IFBAF_TYPEMASK) == IFBAF_DYNAMIC) { - if (time_second >= brt->brt_expire) + if (time_uptime >= brt->brt_expire) bridge_rtnode_destroy(sc, brt); } } -- cgit v1.1