aboutsummaryrefslogtreecommitdiff
path: root/networking/udhcp/dhcpc.c
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2008-04-02 13:04:19 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2008-04-02 13:04:19 +0000
commit2e4c3c4cc3c2f6bdd3bfbafe9980f46b24971009 (patch)
treee7e729631b8b8150cb25349534ae16c2d7f12562 /networking/udhcp/dhcpc.c
parent0edbdd8ac8c0add7902d73a7ef921abba9f5752a (diff)
downloadbusybox-2e4c3c4cc3c2f6bdd3bfbafe9980f46b24971009.tar.gz
udhcpc: add -o "do not request options by default" switch
(by L. Gabriel Somlo <somlo AT cmu.edu>) function old new delta udhcpc_main 2513 2554 +41 static.udhcpc_longopts 226 247 +21 add_param_req_option 119 132 +13 packed_usage 23952 23964 +12 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 4/0 up/down: 87/0) Total: 87 bytes
Diffstat (limited to 'networking/udhcp/dhcpc.c')
-rw-r--r--networking/udhcp/dhcpc.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/networking/udhcp/dhcpc.c b/networking/udhcp/dhcpc.c
index bc0676152..fb328cb03 100644
--- a/networking/udhcp/dhcpc.c
+++ b/networking/udhcp/dhcpc.c
@@ -182,6 +182,7 @@ int udhcpc_main(int argc ATTRIBUTE_UNUSED, char **argv)
OPT_W = 1 << 21,
#endif
OPT_P = 1 << 22,
+ OPT_o = 1 << 23,
};
#if ENABLE_GETOPT_LONG
static const char udhcpc_longopts[] ALIGN1 =
@@ -211,6 +212,7 @@ int udhcpc_main(int argc ATTRIBUTE_UNUSED, char **argv)
#if ENABLE_FEATURE_UDHCP_PORT
"client-port\0" Required_argument "P"
#endif
+ "no-default-options\0" No_argument "o"
;
#endif
/* Default options. */
@@ -230,7 +232,7 @@ int udhcpc_main(int argc ATTRIBUTE_UNUSED, char **argv)
opt = getopt32(argv, "c:CV:fbH:h:F:i:np:qRr:s:T:t:vSA:"
USE_FEATURE_UDHCPC_ARPING("aW:")
USE_FEATURE_UDHCP_PORT("P:")
- "O:"
+ "O:o"
, &str_c, &str_V, &str_h, &str_h, &str_F
, &client_config.interface, &client_config.pidfile, &str_r
, &client_config.script
@@ -291,6 +293,8 @@ int udhcpc_main(int argc ATTRIBUTE_UNUSED, char **argv)
SERVER_PORT = CLIENT_PORT - 1;
}
#endif
+ if (opt & OPT_o)
+ client_config.no_default_options = 1;
while (list_O) {
int n = index_in_strings(dhcp_option_strings, list_O->data);
if (n < 0)