Lines 1-6
Link Here
|
1 |
--- client/dhclient.c.orig Sat Apr 26 23:51:39 2003 |
1 |
--- client/dhclient.c.orig Wed Nov 24 18:39:14 2004 |
2 |
+++ client/dhclient.c Wed Mar 3 16:21:02 2004 |
2 |
+++ client/dhclient.c Tue Mar 8 14:06:59 2005 |
3 |
@@ -47,6 +47,13 @@ |
3 |
@@ -38,6 +38,13 @@ |
4 |
#include "dhcpd.h" |
4 |
#include "dhcpd.h" |
5 |
#include "version.h" |
5 |
#include "version.h" |
6 |
|
6 |
|
Lines 11-20
Link Here
|
11 |
+#include <net80211/ieee80211.h> |
11 |
+#include <net80211/ieee80211.h> |
12 |
+#endif |
12 |
+#endif |
13 |
+ |
13 |
+ |
14 |
TIME cur_time; |
|
|
15 |
TIME default_lease_time = 43200; /* 12 hours... */ |
14 |
TIME default_lease_time = 43200; /* 12 hours... */ |
16 |
TIME max_lease_time = 86400; /* 24 hours... */ |
15 |
TIME max_lease_time = 86400; /* 24 hours... */ |
17 |
@@ -82,8 +89,11 @@ |
16 |
|
|
|
17 |
@@ -72,8 +79,11 @@ |
18 |
struct string_list *client_env=NULL; |
18 |
struct string_list *client_env=NULL; |
19 |
int client_env_count=0; |
19 |
int client_env_count=0; |
20 |
int onetry=0; |
20 |
int onetry=0; |
Lines 27-33
Link Here
|
27 |
|
27 |
|
28 |
static void usage PROTO ((void)); |
28 |
static void usage PROTO ((void)); |
29 |
|
29 |
|
30 |
@@ -184,6 +194,9 @@ |
30 |
@@ -174,6 +184,9 @@ |
31 |
} else if (!strcmp (argv [i], "-q")) { |
31 |
} else if (!strcmp (argv [i], "-q")) { |
32 |
quiet = 1; |
32 |
quiet = 1; |
33 |
quiet_interface_discovery = 1; |
33 |
quiet_interface_discovery = 1; |
Lines 37-43
Link Here
|
37 |
} else if (!strcmp (argv [i], "-s")) { |
37 |
} else if (!strcmp (argv [i], "-s")) { |
38 |
if (++i == argc) |
38 |
if (++i == argc) |
39 |
usage (); |
39 |
usage (); |
40 |
@@ -197,6 +210,19 @@ |
40 |
@@ -187,6 +200,19 @@ |
41 |
} else if (!strcmp (argv [i], "-n")) { |
41 |
} else if (!strcmp (argv [i], "-n")) { |
42 |
/* do not start up any interfaces */ |
42 |
/* do not start up any interfaces */ |
43 |
interfaces_requested = 1; |
43 |
interfaces_requested = 1; |
Lines 57-63
Link Here
|
57 |
} else if (!strcmp (argv [i], "-w")) { |
57 |
} else if (!strcmp (argv [i], "-w")) { |
58 |
/* do not exit if there are no broadcast interfaces. */ |
58 |
/* do not exit if there are no broadcast interfaces. */ |
59 |
persist = 1; |
59 |
persist = 1; |
60 |
@@ -225,7 +251,16 @@ |
60 |
@@ -215,7 +241,16 @@ |
61 |
if (strlen (argv [i]) > sizeof tmp -> name) |
61 |
if (strlen (argv [i]) > sizeof tmp -> name) |
62 |
log_fatal ("%s: interface name too long (max %ld)", |
62 |
log_fatal ("%s: interface name too long (max %ld)", |
63 |
argv [i], (long)strlen (argv [i])); |
63 |
argv [i], (long)strlen (argv [i])); |
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 |
@@ -385,6 +420,16 @@ |
78 |
@@ -375,6 +410,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 |
@@ -427,8 +472,13 @@ |
95 |
@@ -417,8 +462,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 |
@@ -486,9 +536,9 @@ |
109 |
@@ -476,9 +526,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 |
@@ -876,6 +926,15 @@ |
122 |
@@ -881,6 +931,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 |
@@ -890,6 +949,12 @@ |
138 |
@@ -895,6 +954,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 |
@@ -1352,6 +1417,11 @@ |
151 |
@@ -1359,6 +1424,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 |
@@ -1464,6 +1534,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 |
@@ -1496,6 +1569,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 |
@@ -1503,6 +1580,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 |
@@ -1548,6 +1630,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 |
@@ -1681,6 +1769,18 @@ |
209 |
@@ -1689,6 +1777,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 |
@@ -1702,6 +1802,16 @@ |
228 |
@@ -1710,6 +1810,16 @@ |
229 |
from, &destination, |
229 |
from, &destination, |
230 |
(struct hardware *)0); |
230 |
(struct hardware *)0); |
231 |
|
231 |
|
Lines 242-248
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 |
@@ -2597,6 +2707,13 @@ |
245 |
@@ -2607,6 +2717,13 @@ |
246 |
wstatus = 0; |
246 |
wstatus = 0; |
247 |
} |
247 |
} |
248 |
} else { |
248 |
} else { |
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 |
@@ -2783,8 +2900,10 @@ |
259 |
@@ -2793,8 +2910,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 |
@@ -3010,7 +3129,9 @@ |
270 |
@@ -3022,7 +3141,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 |
@@ -3147,3 +3268,265 @@ |
280 |
@@ -3160,3 +3281,265 @@ |
281 |
data_string_forget (&ddns_dhcid, MDL); |
281 |
data_string_forget (&ddns_dhcid, MDL); |
282 |
return rcode; |
282 |
return rcode; |
283 |
} |
283 |
} |