From f3763db2364b6e7ee83cc9d8cdd8c304e9d4a329 Mon Sep 17 00:00:00 2001 From: Theo de Raadt Date: Sun, 21 Apr 2013 04:37:30 +0000 Subject: as in dvmrpd: the DVMRP protocol generation number can work beyond 2038 because it is unsigned. Cast it specifically, with a comment, to make this more clear. --- usr.sbin/mrouted/main.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'usr.sbin/mrouted') diff --git a/usr.sbin/mrouted/main.c b/usr.sbin/mrouted/main.c index e3afa0da040..61bf49effd0 100644 --- a/usr.sbin/mrouted/main.c +++ b/usr.sbin/mrouted/main.c @@ -78,7 +78,7 @@ main(int argc, char *argv[]) register int recvlen; int dummy; FILE *fp; - struct timeval tv; + struct timeval now; u_int32_t prev_genid; struct pollfd *pfd; int vers, n, i, ch; @@ -174,8 +174,8 @@ usage: fprintf(stderr, /* * Get generation id */ - gettimeofday(&tv, 0); - dvmrp_genid = tv.tv_sec; + gettimeofday(&now, NULL); + dvmrp_genid = (u_int32_t)now.tv_sec; /* for a while after 2038 */ fp = fopen(genidfilename, "r"); if (fp != NULL) { -- cgit v1.2.3