Lines 1-5
Link Here
|
1 |
--- client/dhclient.c.orig Thu Apr 27 23:38:29 2006 |
1 |
--- client/dhclient.c.orig 2008-01-22 17:28:23.000000000 +0000 |
2 |
+++ client/dhclient.c Sat May 6 17:34:55 2006 |
2 |
+++ client/dhclient.c 2008-05-26 08:17:53.000000000 +0000 |
3 |
@@ -38,6 +38,13 @@ |
3 |
@@ -38,6 +38,13 @@ |
4 |
#include "dhcpd.h" |
4 |
#include "dhcpd.h" |
5 |
#include "version.h" |
5 |
#include "version.h" |
Lines 75-81
Link Here
|
75 |
if (interfaces) { |
75 |
if (interfaces) { |
76 |
interface_reference (&tmp -> next, |
76 |
interface_reference (&tmp -> next, |
77 |
interfaces, MDL); |
77 |
interfaces, MDL); |
78 |
@@ -375,6 +410,16 @@ |
78 |
@@ -373,6 +408,16 @@ |
79 |
INTERFACE_AUTOMATIC)) != |
79 |
INTERFACE_AUTOMATIC)) != |
80 |
INTERFACE_REQUESTED)) |
80 |
INTERFACE_REQUESTED)) |
81 |
continue; |
81 |
continue; |
Lines 92-98
Link Here
|
92 |
script_init (ip -> client, |
92 |
script_init (ip -> client, |
93 |
"PREINIT", (struct string_list *)0); |
93 |
"PREINIT", (struct string_list *)0); |
94 |
if (ip -> client -> alias) |
94 |
if (ip -> client -> alias) |
95 |
@@ -417,8 +462,13 @@ |
95 |
@@ -415,8 +460,13 @@ |
96 |
client -> state = S_INIT; |
96 |
client -> state = S_INIT; |
97 |
/* Set up a timeout to start the initialization |
97 |
/* Set up a timeout to start the initialization |
98 |
process. */ |
98 |
process. */ |
Lines 106-112
Link Here
|
106 |
} |
106 |
} |
107 |
} |
107 |
} |
108 |
} |
108 |
} |
109 |
@@ -476,9 +526,9 @@ |
109 |
@@ -474,9 +524,9 @@ |
110 |
log_info (arr); |
110 |
log_info (arr); |
111 |
log_info (url); |
111 |
log_info (url); |
112 |
|
112 |
|
Lines 119-125
Link Here
|
119 |
"[-pf pid-file] [-e VAR=val]"); |
119 |
"[-pf pid-file] [-e VAR=val]"); |
120 |
log_fatal (" [-sf script-file] [interface]"); |
120 |
log_fatal (" [-sf script-file] [interface]"); |
121 |
} |
121 |
} |
122 |
@@ -879,6 +929,15 @@ |
122 |
@@ -877,6 +927,15 @@ |
123 |
/* Write out the new lease. */ |
123 |
/* Write out the new lease. */ |
124 |
write_client_lease (client, client -> new, 0, 0); |
124 |
write_client_lease (client, client -> new, 0, 0); |
125 |
|
125 |
|
Lines 135-141
Link Here
|
135 |
/* Replace the old active lease with the new one. */ |
135 |
/* Replace the old active lease with the new one. */ |
136 |
if (client -> active) |
136 |
if (client -> active) |
137 |
destroy_client_lease (client -> active); |
137 |
destroy_client_lease (client -> active); |
138 |
@@ -893,6 +952,12 @@ |
138 |
@@ -891,6 +950,12 @@ |
139 |
piaddr (client -> active -> address), |
139 |
piaddr (client -> active -> address), |
140 |
(long)(client -> active -> renewal - cur_time)); |
140 |
(long)(client -> active -> renewal - cur_time)); |
141 |
client -> state = S_BOUND; |
141 |
client -> state = S_BOUND; |
Lines 148-154
Link Here
|
148 |
reinitialize_interfaces (); |
148 |
reinitialize_interfaces (); |
149 |
go_daemon (); |
149 |
go_daemon (); |
150 |
if (client -> config -> do_forward_update) { |
150 |
if (client -> config -> do_forward_update) { |
151 |
@@ -1357,6 +1422,11 @@ |
151 |
@@ -1376,6 +1441,11 @@ |
152 |
int interval; |
152 |
int interval; |
153 |
int increase = 1; |
153 |
int increase = 1; |
154 |
|
154 |
|
Lines 160-166
Link Here
|
160 |
/* Figure out how long it's been since we started transmitting. */ |
160 |
/* Figure out how long it's been since we started transmitting. */ |
161 |
interval = cur_time - client -> first_sending; |
161 |
interval = cur_time - client -> first_sending; |
162 |
|
162 |
|
163 |
@@ -1457,6 +1527,9 @@ |
163 |
@@ -1476,6 +1546,9 @@ |
164 |
struct client_lease *loop; |
164 |
struct client_lease *loop; |
165 |
struct client_lease *lp; |
165 |
struct client_lease *lp; |
166 |
|
166 |
|
Lines 170-176
Link Here
|
170 |
loop = lp = client -> active; |
170 |
loop = lp = client -> active; |
171 |
|
171 |
|
172 |
log_info ("No DHCPOFFERS received."); |
172 |
log_info ("No DHCPOFFERS received."); |
173 |
@@ -1489,6 +1562,10 @@ |
173 |
@@ -1508,6 +1581,10 @@ |
174 |
log_info ("bound: renewal in %ld %s.", |
174 |
log_info ("bound: renewal in %ld %s.", |
175 |
(long)(client -> active -> renewal - |
175 |
(long)(client -> active -> renewal - |
176 |
cur_time), "seconds"); |
176 |
cur_time), "seconds"); |
Lines 181-187
Link Here
|
181 |
add_timeout (client -> active -> renewal, |
181 |
add_timeout (client -> active -> renewal, |
182 |
state_bound, client, 0, 0); |
182 |
state_bound, client, 0, 0); |
183 |
} else { |
183 |
} else { |
184 |
@@ -1496,6 +1573,11 @@ |
184 |
@@ -1515,6 +1592,11 @@ |
185 |
log_info ("bound: immediate renewal."); |
185 |
log_info ("bound: immediate renewal."); |
186 |
state_bound (client); |
186 |
state_bound (client); |
187 |
} |
187 |
} |
Lines 193-199
Link Here
|
193 |
reinitialize_interfaces (); |
193 |
reinitialize_interfaces (); |
194 |
go_daemon (); |
194 |
go_daemon (); |
195 |
return; |
195 |
return; |
196 |
@@ -1541,6 +1623,12 @@ |
196 |
@@ -1560,6 +1642,12 @@ |
197 |
} |
197 |
} |
198 |
|
198 |
|
199 |
log_info ("No working leases in persistent database - sleeping."); |
199 |
log_info ("No working leases in persistent database - sleeping."); |
Lines 206-212
Link Here
|
206 |
script_init (client, "FAIL", (struct string_list *)0); |
206 |
script_init (client, "FAIL", (struct string_list *)0); |
207 |
if (client -> alias) |
207 |
if (client -> alias) |
208 |
script_write_params (client, "alias_", client -> alias); |
208 |
script_write_params (client, "alias_", client -> alias); |
209 |
@@ -1682,6 +1770,18 @@ |
209 |
@@ -1701,6 +1789,18 @@ |
210 |
client -> packet.secs = htons (65535); |
210 |
client -> packet.secs = htons (65535); |
211 |
} |
211 |
} |
212 |
|
212 |
|
Lines 225-231
Link Here
|
225 |
log_info ("DHCPREQUEST on %s to %s port %d", |
225 |
log_info ("DHCPREQUEST on %s to %s port %d", |
226 |
client -> name ? client -> name : client -> interface -> name, |
226 |
client -> name ? client -> name : client -> interface -> name, |
227 |
inet_ntoa (destination.sin_addr), |
227 |
inet_ntoa (destination.sin_addr), |
228 |
@@ -1703,6 +1803,16 @@ |
228 |
@@ -1722,6 +1822,16 @@ |
229 |
from, &destination, |
229 |
from, &destination, |
230 |
(struct hardware *)0); |
230 |
(struct hardware *)0); |
231 |
|
231 |
|
Lines 242-251
Link Here
|
242 |
add_timeout (cur_time + client -> interval, |
242 |
add_timeout (cur_time + client -> interval, |
243 |
send_request, client, 0, 0); |
243 |
send_request, client, 0, 0); |
244 |
} |
244 |
} |
245 |
@@ -2600,6 +2710,13 @@ |
245 |
@@ -2624,6 +2734,13 @@ |
246 |
wstatus = 0; |
246 |
*/ |
247 |
} |
247 |
if (leaseFile != NULL) |
248 |
} else { |
248 |
fclose(leaseFile); |
249 |
+ if ((i = open(_PATH_DEVNULL, O_RDWR)) != -1) { |
249 |
+ if ((i = open(_PATH_DEVNULL, O_RDWR)) != -1) { |
250 |
+ dup2(i, STDIN_FILENO); |
250 |
+ dup2(i, STDIN_FILENO); |
251 |
+ dup2(i, STDOUT_FILENO); |
251 |
+ dup2(i, STDOUT_FILENO); |
Lines 256-262
Link Here
|
256 |
execve (scriptName, argv, envp); |
256 |
execve (scriptName, argv, envp); |
257 |
log_error ("execve (%s, ...): %m", scriptName); |
257 |
log_error ("execve (%s, ...): %m", scriptName); |
258 |
exit (0); |
258 |
exit (0); |
259 |
@@ -2786,8 +2903,10 @@ |
259 |
@@ -2810,8 +2927,10 @@ |
260 |
case S_STOPPED: |
260 |
case S_STOPPED: |
261 |
break; |
261 |
break; |
262 |
} |
262 |
} |
Lines 267-273
Link Here
|
267 |
} |
267 |
} |
268 |
} |
268 |
} |
269 |
} |
269 |
} |
270 |
@@ -3015,7 +3134,9 @@ |
270 |
@@ -3039,7 +3158,9 @@ |
271 |
break; |
271 |
break; |
272 |
|
272 |
|
273 |
case server_awaken: |
273 |
case server_awaken: |
Lines 277-283
Link Here
|
277 |
break; |
277 |
break; |
278 |
} |
278 |
} |
279 |
} |
279 |
} |
280 |
@@ -3153,3 +3274,265 @@ |
280 |
@@ -3177,3 +3298,265 @@ |
281 |
data_string_forget (&ddns_dhcid, MDL); |
281 |
data_string_forget (&ddns_dhcid, MDL); |
282 |
return rcode; |
282 |
return rcode; |
283 |
} |
283 |
} |