]> git.ipfire.org Git - people/arne_f/ipfire-3.x.git/blame - dhcp/patches/0014-dhcp-64_bit_lease_parse.patch
dhcp: Update to 4.3.5b1
[people/arne_f/ipfire-3.x.git] / dhcp / patches / 0014-dhcp-64_bit_lease_parse.patch
CommitLineData
d8feb2d7
SS
1diff -up dhcp-4.3.0a1/common/parse.c.64-bit_lease_parse dhcp-4.3.0a1/common/parse.c
2--- dhcp-4.3.0a1/common/parse.c.64-bit_lease_parse 2013-12-11 01:25:12.000000000 +0100
3+++ dhcp-4.3.0a1/common/parse.c 2013-12-19 15:45:25.990771814 +0100
4@@ -938,8 +938,8 @@ TIME
6df985df
SS
5 parse_date_core(cfile)
6 struct parse *cfile;
7 {
8- int guess;
444c1184 9- int tzoff, year, mon, mday, hour, min, sec;
6df985df 10+ TIME guess;
444c1184 11+ long int tzoff, year, mon, mday, hour, min, sec;
6df985df
SS
12 const char *val;
13 enum dhcp_token token;
14 static int months[11] = { 31, 59, 90, 120, 151, 181,
d8feb2d7 15@@ -965,7 +965,7 @@ parse_date_core(cfile)
6df985df
SS
16 }
17
d8feb2d7 18 skip_token(&val, NULL, cfile); /* consume number */
6df985df
SS
19- guess = atoi(val);
20+ guess = atol(val);
21
22 return((TIME)guess);
23 }
d8feb2d7 24@@ -993,7 +993,7 @@ parse_date_core(cfile)
6df985df
SS
25 somebody invents a time machine, I think we can safely disregard
26 it. This actually works around a stupid Y2K bug that was present
27 in a very early beta release of dhcpd. */
28- year = atoi(val);
29+ year = atol(val);
30 if (year > 1900)
31 year -= 1900;
32
d8feb2d7 33@@ -1039,7 +1039,7 @@ parse_date_core(cfile)
6df985df
SS
34 return((TIME)0);
35 }
d8feb2d7 36 skip_token(&val, NULL, cfile); /* consume day of month */
6df985df
SS
37- mday = atoi(val);
38+ mday = atol(val);
39
40 /* Hour... */
41 token = peek_token(&val, NULL, cfile);
d8feb2d7 42@@ -1050,7 +1050,7 @@ parse_date_core(cfile)
6df985df
SS
43 return((TIME)0);
44 }
d8feb2d7 45 skip_token(&val, NULL, cfile); /* consume hour */
6df985df
SS
46- hour = atoi(val);
47+ hour = atol(val);
48
49 /* Colon separating hour from minute... */
50 token = peek_token(&val, NULL, cfile);
d8feb2d7 51@@ -1072,7 +1072,7 @@ parse_date_core(cfile)
6df985df
SS
52 return((TIME)0);
53 }
d8feb2d7 54 skip_token(&val, NULL, cfile); /* consume minute */
6df985df
SS
55- min = atoi(val);
56+ min = atol(val);
57
58 /* Colon separating minute from second... */
59 token = peek_token(&val, NULL, cfile);
d8feb2d7 60@@ -1094,13 +1094,13 @@ parse_date_core(cfile)
6df985df
SS
61 return((TIME)0);
62 }
d8feb2d7 63 skip_token(&val, NULL, cfile); /* consume second */
6df985df
SS
64- sec = atoi(val);
65+ sec = atol(val);
66
67 tzoff = 0;
68 token = peek_token(&val, NULL, cfile);
69 if (token == NUMBER) {
d8feb2d7 70 skip_token(&val, NULL, cfile); /* consume tzoff */
6df985df
SS
71- tzoff = atoi(val);
72+ tzoff = atol(val);
73 } else if (token != SEMI) {
d8feb2d7 74 skip_token(&val, NULL, cfile);
6df985df 75 parse_warn(cfile,