diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2018-04-13 13:18:34 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2018-04-13 13:27:52 +0200 |
commit | 266f6f19732f9b35487a87a346e58c1c3a0af43d (patch) | |
tree | 10489c89deea2665170fd4006c11b951dc284ee9 /networking/udhcp/dhcpc.c | |
parent | 46158dc833ca48a63a2547bb26eee133aa19dccf (diff) | |
download | busybox-w32-266f6f19732f9b35487a87a346e58c1c3a0af43d.tar.gz busybox-w32-266f6f19732f9b35487a87a346e58c1c3a0af43d.tar.bz2 busybox-w32-266f6f19732f9b35487a87a346e58c1c3a0af43d.zip |
udhcp: support string user options, closes 10946
function old new delta
udhcp_str2optset 536 628 +92
packed_usage 32757 32760 +3
udhcpc_main 2708 2692 -16
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 2/1 up/down: 95/-16) Total: 79 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'networking/udhcp/dhcpc.c')
-rw-r--r-- | networking/udhcp/dhcpc.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/networking/udhcp/dhcpc.c b/networking/udhcp/dhcpc.c index 90b07bf4b..bd9e8fdc2 100644 --- a/networking/udhcp/dhcpc.c +++ b/networking/udhcp/dhcpc.c | |||
@@ -1224,6 +1224,7 @@ static void client_background(void) | |||
1224 | //usage: "\n -x hostname:bbox - option 12" | 1224 | //usage: "\n -x hostname:bbox - option 12" |
1225 | //usage: "\n -x lease:3600 - option 51 (lease time)" | 1225 | //usage: "\n -x lease:3600 - option 51 (lease time)" |
1226 | //usage: "\n -x 0x3d:0100BEEFC0FFEE - option 61 (client id)" | 1226 | //usage: "\n -x 0x3d:0100BEEFC0FFEE - option 61 (client id)" |
1227 | //usage: "\n -x 14:'\"dumpfile\"' - option 14 (shell-quoted)" | ||
1227 | //usage: "\n -F NAME Ask server to update DNS mapping for NAME" | 1228 | //usage: "\n -F NAME Ask server to update DNS mapping for NAME" |
1228 | //usage: "\n -V VENDOR Vendor identifier (default 'udhcp VERSION')" | 1229 | //usage: "\n -V VENDOR Vendor identifier (default 'udhcp VERSION')" |
1229 | //usage: "\n -C Don't send MAC as client identifier" | 1230 | //usage: "\n -C Don't send MAC as client identifier" |
@@ -1335,15 +1336,9 @@ int udhcpc_main(int argc UNUSED_PARAM, char **argv) | |||
1335 | } | 1336 | } |
1336 | } | 1337 | } |
1337 | while (list_x) { | 1338 | while (list_x) { |
1338 | char *optstr = llist_pop(&list_x); | 1339 | char *optstr = xstrdup(llist_pop(&list_x)); |
1339 | char *colon = strchr(optstr, ':'); | ||
1340 | if (colon) | ||
1341 | *colon = ' '; | ||
1342 | /* now it looks similar to udhcpd's config file line: | ||
1343 | * "optname optval", using the common routine: */ | ||
1344 | udhcp_str2optset(optstr, &client_config.options, dhcp_optflags, dhcp_option_strings); | 1340 | udhcp_str2optset(optstr, &client_config.options, dhcp_optflags, dhcp_option_strings); |
1345 | if (colon) | 1341 | free(optstr); |
1346 | *colon = ':'; /* restore it for NOMMU reexec */ | ||
1347 | } | 1342 | } |
1348 | 1343 | ||
1349 | if (udhcp_read_interface(client_config.interface, | 1344 | if (udhcp_read_interface(client_config.interface, |