summaryrefslogtreecommitdiff
path: root/net/isc-dhcp30-server/files/patch-server::dhcp.c
blob: 94981458272ee0691140230307f730a5be931324 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
--- server/dhcp.c.orig	Wed Feb 22 23:43:27 2006
+++ server/dhcp.c	Mon May 22 01:39:59 2006
@@ -2442,6 +2442,7 @@
 		offered_lease_time =
 			state -> offered_expiry - cur_time;
 
+		state -> expiry = 0;
 		putULong ((unsigned char *)&state -> expiry,
 			  (unsigned long)offered_lease_time);
 		i = DHO_DHCP_LEASE_TIME;
@@ -2452,7 +2453,7 @@
 		if (option_cache_allocate (&oc, MDL)) {
 			if (make_const_data (&oc -> expression,
 					     (unsigned char *)&state -> expiry,
-					     sizeof state -> expiry,
+					     4,
 					     0, 0, MDL)) {
 				oc -> option = dhcp_universe.options [i];
 				save_option (&dhcp_universe,
@@ -2463,6 +2464,7 @@
 
 		/* Renewal time is lease time * 0.5. */
 		offered_lease_time /= 2;
+		state -> renewal = 0;
 		putULong ((unsigned char *)&state -> renewal,
 			  (unsigned long)offered_lease_time);
 		i = DHO_DHCP_RENEWAL_TIME;
@@ -2474,7 +2476,7 @@
 			if (make_const_data (&oc -> expression,
 					     (unsigned char *)
 					     &state -> renewal,
-					     sizeof state -> renewal,
+					     4,
 					     0, 0, MDL)) {
 				oc -> option = dhcp_universe.options [i];
 				save_option (&dhcp_universe,
@@ -2486,6 +2488,7 @@
 		/* Rebinding time is lease time * 0.875. */
 		offered_lease_time += (offered_lease_time / 2
 				       + offered_lease_time / 4);
+		state -> rebind = 0;
 		putULong ((unsigned char *)&state -> rebind,
 			  (unsigned)offered_lease_time);
 		i = DHO_DHCP_REBINDING_TIME;
@@ -2496,7 +2499,7 @@
 		if (option_cache_allocate (&oc, MDL)) {
 			if (make_const_data (&oc -> expression,
 					     (unsigned char *)&state -> rebind,
-					     sizeof state -> rebind,
+					     4,
 					     0, 0, MDL)) {
 				oc -> option = dhcp_universe.options [i];
 				save_option (&dhcp_universe,