From 5e9a131f20894d1df9e8c1768be6eb1cc29a3cf4 Mon Sep 17 00:00:00 2001 From: phk Date: Sat, 4 Apr 1998 13:26:20 +0000 Subject: Time changes mark 2: * Figure out UTC relative to boottime. Four new functions provide time relative to boottime. * move "runtime" into struct proc. This helps fix the calcru() problem in SMP. * kill mono_time. * add timespec{add|sub|cmp} macros to time.h. (XXX: These may change!) * nanosleep, select & poll takes long sleeps one day at a time Reviewed by: bde Tested by: ache and others --- sys/net/if_spppsubr.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'sys/net/if_spppsubr.c') diff --git a/sys/net/if_spppsubr.c b/sys/net/if_spppsubr.c index 0f890cb..74310e3 100644 --- a/sys/net/if_spppsubr.c +++ b/sys/net/if_spppsubr.c @@ -17,7 +17,7 @@ * * From: Version 2.4, Thu Apr 30 17:17:21 MSD 1997 * - * $Id: if_spppsubr.c,v 1.34 1998/03/01 06:01:33 bde Exp $ + * $Id: if_spppsubr.c,v 1.35 1998/03/30 09:52:06 phk Exp $ */ #include "opt_inet.h" @@ -1018,8 +1018,10 @@ sppp_cisco_send(struct sppp *sp, int type, long par1, long par2) struct ppp_header *h; struct cisco_packet *ch; struct mbuf *m; - u_long t = (time_second - boottime.tv_sec) * 1000; + struct timeval tv; + getmicroruntime(&tv); + MGETHDR (m, M_DONTWAIT, MT_DATA); if (! m) return; @@ -1036,8 +1038,8 @@ sppp_cisco_send(struct sppp *sp, int type, long par1, long par2) ch->par1 = htonl (par1); ch->par2 = htonl (par2); ch->rel = -1; - ch->time0 = htons ((u_short) (t >> 16)); - ch->time1 = htons ((u_short) t); + ch->time0 = htons ((u_short) (tv.tv_sec >> 16)); + ch->time1 = htons ((u_short) tv.tv_sec); if (debug) log(LOG_DEBUG, -- cgit v1.1