summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2013-04-21 04:33:42 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2013-04-21 04:33:42 +0000
commit1e4c2b764bcba78c22bbf4333a2afc53da3464b8 (patch)
tree4f9b5a8559affbe16b970732432f4f67f5b6f5d7 /usr.sbin
parent7632cd5170988874a19eafc1c736f68d2c8e469c (diff)
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')
-rw-r--r--usr.sbin/dvmrpd/parse.y5
1 files changed, 2 insertions, 3 deletions
diff --git a/usr.sbin/dvmrpd/parse.y b/usr.sbin/dvmrpd/parse.y
index 3cd88e91752..4aa4fe08c7b 100644
--- a/usr.sbin/dvmrpd/parse.y
+++ b/usr.sbin/dvmrpd/parse.y
@@ -1,4 +1,4 @@
-/* $OpenBSD: parse.y,v 1.23 2013/03/06 21:42:40 sthen Exp $ */
+/* $OpenBSD: parse.y,v 1.24 2013/04/21 04:33:41 deraadt Exp $ */
/*
* Copyright (c) 2004, 2005, 2006 Esben Norby <norby@openbsd.org>
@@ -745,9 +745,8 @@ parse_config(char *filename, int opts)
}
topfile = file;
- /* Generation ID must be non decreasing */
gettimeofday(&now, NULL);
- conf->gen_id = now.tv_sec;
+ conf->gen_id = (u_int32_t)now.tv_sec; /* for a while after 2038 */
conf->opts = opts;
yyparse();