Date: Sun, 5 Apr 1998 16:56:17 +0200 (MET DST) From: Wolfgang Helbig <helbig@Informatik.BA-Stuttgart.DE> To: garyj@muc.de Cc: hm@hcs.de (Hellmuth Michaelis), freebsd-isdn@FreeBSD.ORG Subject: Re: -current: Undefined symbol `_time' referenced from text segment Message-ID: <199804051456.QAA00283@rvc1.informatik.ba-stuttgart.de> In-Reply-To: <199804051248.OAA02553@peedub.muc.de> from Gary Jennejohn at "Apr 5, 98 02:48:36 pm"
next in thread | previous in thread | raw e-mail | index | archive | help
> Wolfgang Helbig writes: > >> unfortuantely, you eliminated some changes which NetBSD requires. Otherwise, > > > >Oops, sorry about that. I really tried not to ... > >Where did I screw it up? > > > > some deletions were merely in comments, so not harmful (that's how I noticed > that you'd deleted NetBSD stuff). Don't know how that happened. Here is another try. This is a diff for if_spppsubr.c only, this time w/o deleting comments and breaking NetBSD support (hopefully). Hellmuth, please don't apply the if_spppsubr.c patch from the big diff I sent yesterday, it's at the end of the file. Instead try this one: Wolfgang --- /home/helbig/src/i4b/sppp/if_spppsubr.c Thu Mar 19 20:36:57 1998 +++ sppp/if_spppsubr.c Sun Apr 5 16:40:58 1998 @@ -17,7 +17,7 @@ * * From: Version 2.4, Thu Apr 30 17:17:21 MSD 1997 * - * From: if_spppsubr.c,v 1.32 1998/02/09 06:09:57 eivind Exp + * From: if_spppsubr.c,v 1.36 1998/04/04 13:26:03 phk Exp * * $Id: if_spppsubr.c,v 1.10 1998/03/19 19:36:57 hm Exp $ */ @@ -33,6 +33,9 @@ #include <sys/sockio.h> #include <sys/socket.h> #include <sys/syslog.h> +#if defined(__FreeBSD__) && __FreeBSD__ >= 3 +#include <machine/random.h> +#endif #include <sys/malloc.h> #include <sys/mbuf.h> #include <sys/md5.h> @@ -1031,7 +1034,11 @@ ++sp->pp_loopcnt; /* Generate new local sequence number */ +#if defined(__FreeBSD__) && __FreeBSD__ >= 3 + read_random((char*)&sp->pp_seq, sizeof sp->pp_seq); +#else sp->pp_seq ^= time.tv_sec ^ time.tv_usec; +#endif break; } sp->pp_loopcnt = 0; @@ -1059,8 +1066,16 @@ struct ppp_header *h; struct cisco_packet *ch; struct mbuf *m; +#if defined(__FreeBSD__) && __FreeBSD__ >= 3 + struct timeval tv; +#else u_long t = (time.tv_sec - boottime.tv_sec) * 1000; +#endif +#if defined(__FreeBSD__) && __FreeBSD__ >= 3 + getmicroruntime(&tv); +#endif + MGETHDR (m, M_DONTWAIT, MT_DATA); if (! m) return; @@ -1077,8 +1092,14 @@ ch->par1 = htonl (par1); ch->par2 = htonl (par2); ch->rel = -1; + +#if defined(__FreeBSD__) && __FreeBSD__ >= 3 + ch->time0 = htons ((u_short) (tv.tv_sec >> 16)); + ch->time1 = htons ((u_short) tv.tv_sec); +#else ch->time0 = htons ((u_short) (t >> 16)); ch->time1 = htons ((u_short) t); +#endif if (debug) log(LOG_DEBUG, @@ -2168,7 +2189,11 @@ if (magic == ~sp->lcp.magic) { if (debug) addlog("magic glitch "); - sp->lcp.magic += time.tv_sec + time.tv_usec; +#if defined(__FreeBSD__) && __FreeBSD__ >= 3 + read_random((char*)&sp->lcp.magic, sizeof sp->lcp.magic); +#else + sp->lcp.magic = time.tv_sec + time.tv_usec; +#endif } else { sp->lcp.magic = magic; if (debug) @@ -2328,7 +2353,11 @@ if (sp->lcp.opts & (1 << LCP_OPT_MAGIC)) { if (! sp->lcp.magic) +#if defined(__FreeBSD__) && __FreeBSD__ >= 3 + read_random((char*)&sp->lcp.magic, sizeof sp->lcp.magic); +#else sp->lcp.magic = time.tv_sec + time.tv_usec; +#endif opt[i++] = LCP_OPT_MAGIC; opt[i++] = 6; opt[i++] = sp->lcp.magic >> 24; To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-isdn" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199804051456.QAA00283>