summaryrefslogtreecommitdiff
path: root/usr.sbin/mrouted
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2013-04-21 04:37:30 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2013-04-21 04:37:30 +0000
commitf3763db2364b6e7ee83cc9d8cdd8c304e9d4a329 (patch)
tree34ba0b9ddd77ca52067b6a2b85cc90e60dab40f1 /usr.sbin/mrouted
parent1e4c2b764bcba78c22bbf4333a2afc53da3464b8 (diff)
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.
Diffstat (limited to 'usr.sbin/mrouted')
-rw-r--r--usr.sbin/mrouted/main.c6
1 files changed, 3 insertions, 3 deletions
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) {