]> git.ipfire.org Git - people/ms/ipfire-3.x.git/blame - dhcp/patches/dhcp-4.2.4-64_bit_lease_parse.patch
dhcp: Update to 4.2.4.
[people/ms/ipfire-3.x.git] / dhcp / patches / dhcp-4.2.4-64_bit_lease_parse.patch
CommitLineData
444c1184
MT
1diff -up dhcp-4.2.4b1/common/parse.c.64-bit_lease_parse dhcp-4.2.4b1/common/parse.c
2--- dhcp-4.2.4b1/common/parse.c.64-bit_lease_parse 2012-03-09 12:28:10.000000000 +0100
3+++ dhcp-4.2.4b1/common/parse.c 2012-04-16 17:30:55.867045149 +0200
4@@ -906,8 +906,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,
444c1184 15@@ -933,7 +933,7 @@ parse_date_core(cfile)
6df985df
SS
16 }
17
18 token = next_token(&val, NULL, cfile); /* consume number */
19- guess = atoi(val);
20+ guess = atol(val);
21
22 return((TIME)guess);
23 }
444c1184 24@@ -961,7 +961,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
444c1184 33@@ -985,7 +985,7 @@ parse_date_core(cfile)
6df985df
SS
34 return((TIME)0);
35 }
36 token = next_token(&val, NULL, cfile); /* consume month */
37- mon = atoi(val) - 1;
38+ mon = atol(val) - 1;
39
40 /* Slash separating month from day... */
41 token = peek_token(&val, NULL, cfile);
444c1184 42@@ -1007,7 +1007,7 @@ parse_date_core(cfile)
6df985df
SS
43 return((TIME)0);
44 }
45 token = next_token(&val, NULL, cfile); /* consume day of month */
46- mday = atoi(val);
47+ mday = atol(val);
48
49 /* Hour... */
50 token = peek_token(&val, NULL, cfile);
444c1184 51@@ -1018,7 +1018,7 @@ parse_date_core(cfile)
6df985df
SS
52 return((TIME)0);
53 }
54 token = next_token(&val, NULL, cfile); /* consume hour */
55- hour = atoi(val);
56+ hour = atol(val);
57
58 /* Colon separating hour from minute... */
59 token = peek_token(&val, NULL, cfile);
444c1184 60@@ -1040,7 +1040,7 @@ parse_date_core(cfile)
6df985df
SS
61 return((TIME)0);
62 }
63 token = next_token(&val, NULL, cfile); /* consume minute */
64- min = atoi(val);
65+ min = atol(val);
66
67 /* Colon separating minute from second... */
68 token = peek_token(&val, NULL, cfile);
444c1184 69@@ -1062,13 +1062,13 @@ parse_date_core(cfile)
6df985df
SS
70 return((TIME)0);
71 }
72 token = next_token(&val, NULL, cfile); /* consume second */
73- sec = atoi(val);
74+ sec = atol(val);
75
76 tzoff = 0;
77 token = peek_token(&val, NULL, cfile);
78 if (token == NUMBER) {
79 token = next_token(&val, NULL, cfile); /* consume tzoff */
80- tzoff = atoi(val);
81+ tzoff = atol(val);
82 } else if (token != SEMI) {
83 token = next_token(&val, NULL, cfile);
84 parse_warn(cfile,