aboutsummaryrefslogtreecommitdiff
path: root/networking
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2007-11-22 21:41:14 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2007-11-22 21:41:14 +0000
commit68af8e7a084317191effa9b257483a50d994b11c (patch)
treec406bce2135c666a2bbdff510b2e05df317bfc36 /networking
parentb559105cfbbfb662a6e15e169a469e8a95a9ccf4 (diff)
downloadbusybox-w32-68af8e7a084317191effa9b257483a50d994b11c.tar.gz
busybox-w32-68af8e7a084317191effa9b257483a50d994b11c.tar.bz2
busybox-w32-68af8e7a084317191effa9b257483a50d994b11c.zip
udhcpc: remove -W option, -A can be reused for that
help texts: trimmed a bit static.udhcpc_longopts 227 209 -18 udhcpc_main 2633 2590 -43 packed_usage 22927 22871 -56 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 0/3 up/down: 0/-117) Total: -117 bytes
Diffstat (limited to 'networking')
-rw-r--r--networking/udhcp/dhcpc.c21
1 files changed, 6 insertions, 15 deletions
diff --git a/networking/udhcp/dhcpc.c b/networking/udhcp/dhcpc.c
index 234ecfd13..6ade1ee34 100644
--- a/networking/udhcp/dhcpc.c
+++ b/networking/udhcp/dhcpc.c
@@ -145,13 +145,12 @@ int udhcpc_main(int argc, char **argv)
145{ 145{
146 uint8_t *temp, *message; 146 uint8_t *temp, *message;
147 char *str_c, *str_V, *str_h, *str_F, *str_r, *str_T, *str_A, *str_t; 147 char *str_c, *str_V, *str_h, *str_F, *str_r, *str_T, *str_A, *str_t;
148 int tryagain_timeout = 60;
149 int discover_timeout = 3;
150 int discover_retries = 3;
151#if ENABLE_FEATURE_UDHCPC_ARPING 148#if ENABLE_FEATURE_UDHCPC_ARPING
152 int decline_wait = 10;
153 char *str_W; 149 char *str_W;
154#endif 150#endif
151 int tryagain_timeout = 20;
152 int discover_timeout = 3;
153 int discover_retries = 3;
155 uint32_t xid = 0; 154 uint32_t xid = 0;
156 uint32_t lease_seconds = 0; /* can be given as 32-bit quantity */ 155 uint32_t lease_seconds = 0; /* can be given as 32-bit quantity */
157 unsigned t1 = 0, t2 = 0; /* what a wonderful names */ 156 unsigned t1 = 0, t2 = 0; /* what a wonderful names */
@@ -199,7 +198,6 @@ int udhcpc_main(int argc, char **argv)
199 "foreground\0" No_argument "f" 198 "foreground\0" No_argument "f"
200 "background\0" No_argument "b" 199 "background\0" No_argument "b"
201 "hostname\0" Required_argument "H" 200 "hostname\0" Required_argument "H"
202 "hostname\0" Required_argument "h"
203 "fqdn\0" Required_argument "F" 201 "fqdn\0" Required_argument "F"
204 "interface\0" Required_argument "i" 202 "interface\0" Required_argument "i"
205 "now\0" No_argument "n" 203 "now\0" No_argument "n"
@@ -215,7 +213,6 @@ int udhcpc_main(int argc, char **argv)
215 "syslog\0" No_argument "S" 213 "syslog\0" No_argument "S"
216#if ENABLE_FEATURE_UDHCPC_ARPING 214#if ENABLE_FEATURE_UDHCPC_ARPING
217 "arping\0" No_argument "a" 215 "arping\0" No_argument "a"
218 "wait\0" Required_argument "W"
219#endif 216#endif
220 ; 217 ;
221#endif 218#endif
@@ -224,8 +221,7 @@ int udhcpc_main(int argc, char **argv)
224 client_config.script = DEFAULT_SCRIPT; 221 client_config.script = DEFAULT_SCRIPT;
225 222
226 /* Parse command line */ 223 /* Parse command line */
227 opt_complementary = "c--C:C--c" // mutually exclusive 224 opt_complementary = "c--C:C--c"; // mutually exclusive
228 ":hH:Hh"; // -h and -H are the same
229#if ENABLE_GETOPT_LONG 225#if ENABLE_GETOPT_LONG
230 applet_long_options = udhcpc_longopts; 226 applet_long_options = udhcpc_longopts;
231#endif 227#endif
@@ -246,7 +242,7 @@ int udhcpc_main(int argc, char **argv)
246 client_config.foreground = 1; 242 client_config.foreground = 1;
247 if (opt & OPT_b) 243 if (opt & OPT_b)
248 client_config.background_if_no_lease = 1; 244 client_config.background_if_no_lease = 1;
249 if (opt & OPT_h) 245 if (opt & (OPT_h|OPT_H))
250 client_config.hostname = alloc_dhcp_option(DHCP_HOST_NAME, str_h, 0); 246 client_config.hostname = alloc_dhcp_option(DHCP_HOST_NAME, str_h, 0);
251 if (opt & OPT_F) { 247 if (opt & OPT_F) {
252 client_config.fqdn = alloc_dhcp_option(DHCP_FQDN, str_F, 3); 248 client_config.fqdn = alloc_dhcp_option(DHCP_FQDN, str_F, 3);
@@ -287,11 +283,6 @@ int udhcpc_main(int argc, char **argv)
287 logmode |= LOGMODE_SYSLOG; 283 logmode |= LOGMODE_SYSLOG;
288 } 284 }
289 285
290#if ENABLE_FEATURE_UDHCPC_ARPING
291 if (opt & OPT_W)
292 decline_wait = xatou_range(str_W, 10, INT_MAX);
293#endif
294
295 if (read_interface(client_config.interface, &client_config.ifindex, 286 if (read_interface(client_config.interface, &client_config.ifindex,
296 NULL, client_config.arp)) 287 NULL, client_config.arp))
297 return 1; 288 return 1;
@@ -536,7 +527,7 @@ int udhcpc_main(int argc, char **argv)
536 change_listen_mode(LISTEN_RAW); 527 change_listen_mode(LISTEN_RAW);
537 state = INIT_SELECTING; 528 state = INIT_SELECTING;
538 requested_ip = 0; 529 requested_ip = 0;
539 timeout = decline_wait; 530 timeout = tryagain_timeout;
540 packet_num = 0; 531 packet_num = 0;
541 continue; /* back to main loop */ 532 continue; /* back to main loop */
542 } 533 }