summaryrefslogtreecommitdiffstats
path: root/sys/net
diff options
context:
space:
mode:
authorandre <andre@FreeBSD.org>2005-09-19 22:27:07 +0000
committerandre <andre@FreeBSD.org>2005-09-19 22:27:07 +0000
commitb2bf25e5cd5fc02fa46d9db548cf496f7ed135b8 (patch)
tree49f1fb3532ac2204a4634836a0f53993993ca4fa /sys/net
parent9a84c48b48266e34d6e7abafd7d94b16eb655b71 (diff)
downloadFreeBSD-src-b2bf25e5cd5fc02fa46d9db548cf496f7ed135b8.zip
FreeBSD-src-b2bf25e5cd5fc02fa46d9db548cf496f7ed135b8.tar.gz
Use monotonic time_uptime instead of 'time_second' as timebase
for timeouts.
Diffstat (limited to 'sys/net')
-rw-r--r--sys/net/if_ppp.c14
-rw-r--r--sys/net/if_sl.c8
-rw-r--r--sys/net/if_spppsubr.c6
3 files changed, 14 insertions, 14 deletions
diff --git a/sys/net/if_ppp.c b/sys/net/if_ppp.c
index 877d94d..a4bb60c 100644
--- a/sys/net/if_ppp.c
+++ b/sys/net/if_ppp.c
@@ -373,7 +373,7 @@ pppalloc(pid)
sc->sc_npmode[i] = NPMODE_ERROR;
sc->sc_npqueue = NULL;
sc->sc_npqtail = &sc->sc_npqueue;
- sc->sc_last_sent = sc->sc_last_recv = time_second;
+ sc->sc_last_sent = sc->sc_last_recv = time_uptime;
return sc;
}
@@ -601,7 +601,7 @@ pppioctl(sc, cmd, data, flag, td)
case PPPIOCGIDLE:
s = splsoftnet();
- t = time_second;
+ t = time_uptime;
((struct ppp_idle *)data)->xmit_idle = t - sc->sc_last_sent;
((struct ppp_idle *)data)->recv_idle = t - sc->sc_last_recv;
splx(s);
@@ -918,14 +918,14 @@ pppoutput(ifp, m0, dst, rtp)
*/
if (sc->sc_active_filt.bf_insns == 0
|| bpf_filter(sc->sc_active_filt.bf_insns, (u_char *) m0, len, 0))
- sc->sc_last_sent = time_second;
+ sc->sc_last_sent = time_uptime;
*mtod(m0, u_char *) = address;
#else
/*
* Update the time we sent the most recent data packet.
*/
- sc->sc_last_sent = time_second;
+ sc->sc_last_sent = time_uptime;
#endif /* PPP_FILTER */
}
@@ -1557,14 +1557,14 @@ ppp_inproc(sc, m)
}
if (sc->sc_active_filt.bf_insns == 0
|| bpf_filter(sc->sc_active_filt.bf_insns, (u_char *) m, ilen, 0))
- sc->sc_last_recv = time_second;
+ sc->sc_last_recv = time_uptime;
*mtod(m, u_char *) = adrs;
#else
/*
* Record the time that we received this packet.
*/
- sc->sc_last_recv = time_second;
+ sc->sc_last_recv = time_uptime;
#endif /* PPP_FILTER */
}
@@ -1607,7 +1607,7 @@ ppp_inproc(sc, m)
m->m_data += PPP_HDRLEN;
m->m_len -= PPP_HDRLEN;
isr = NETISR_IPX;
- sc->sc_last_recv = time_second; /* update time of last pkt rcvd */
+ sc->sc_last_recv = time_uptime; /* update time of last pkt rcvd */
break;
#endif
diff --git a/sys/net/if_sl.c b/sys/net/if_sl.c
index a03ba1c..fefd6b6 100644
--- a/sys/net/if_sl.c
+++ b/sys/net/if_sl.c
@@ -876,15 +876,15 @@ slinput(int c, struct tty *tp)
* this one is within the time limit.
*/
if (sc->sc_abortcount &&
- time_second >= sc->sc_starttime + ABT_WINDOW)
+ time_uptime >= sc->sc_starttime + ABT_WINDOW)
sc->sc_abortcount = 0;
/*
* If we see an abort after "idle" time, count it;
* record when the first abort escape arrived.
*/
- if (time_second >= sc->sc_lasttime + ABT_IDLE) {
+ if (time_uptime >= sc->sc_lasttime + ABT_IDLE) {
if (++sc->sc_abortcount == 1)
- sc->sc_starttime = time_second;
+ sc->sc_starttime = time_uptime;
if (sc->sc_abortcount >= ABT_COUNT) {
slclose(tp,0);
return 0;
@@ -892,7 +892,7 @@ slinput(int c, struct tty *tp)
}
} else
sc->sc_abortcount = 0;
- sc->sc_lasttime = time_second;
+ sc->sc_lasttime = time_uptime;
}
switch (c) {
diff --git a/sys/net/if_spppsubr.c b/sys/net/if_spppsubr.c
index 875cb1c..2db4884 100644
--- a/sys/net/if_spppsubr.c
+++ b/sys/net/if_spppsubr.c
@@ -793,7 +793,7 @@ sppp_input(struct ifnet *ifp, struct mbuf *m)
* packets. This is used by some subsystems to detect
* idle lines.
*/
- sp->pp_last_recv = time_second;
+ sp->pp_last_recv = time_uptime;
}
static void
@@ -1066,7 +1066,7 @@ out:
* network-layer traffic; control-layer traffic is handled
* by sppp_cp_send().
*/
- sp->pp_last_sent = time_second;
+ sp->pp_last_sent = time_uptime;
return (0);
}
@@ -1104,7 +1104,7 @@ sppp_attach(struct ifnet *ifp)
mtx_init(&sp->pp_cpq.ifq_mtx, "sppp_cpq", NULL, MTX_DEF);
if(!mtx_initialized(&sp->pp_fastq.ifq_mtx))
mtx_init(&sp->pp_fastq.ifq_mtx, "sppp_fastq", NULL, MTX_DEF);
- sp->pp_last_recv = sp->pp_last_sent = time_second;
+ sp->pp_last_recv = sp->pp_last_sent = time_uptime;
sp->confflags = 0;
#ifdef INET
sp->confflags |= CONF_ENABLE_VJ;
OpenPOWER on IntegriCloud