diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2007-12-10 07:03:38 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2007-12-10 07:03:38 +0000 |
commit | 191836845e4551fe6191dc0d43b45a0232bff8be (patch) | |
tree | e6fd859b756304842334d0e0603856be2a5948e6 /networking/udhcp/clientpacket.c | |
parent | 75aa615bef478622cd0695b95adcf182fbbc3d95 (diff) | |
download | busybox-w32-191836845e4551fe6191dc0d43b45a0232bff8be.tar.gz busybox-w32-191836845e4551fe6191dc0d43b45a0232bff8be.tar.bz2 busybox-w32-191836845e4551fe6191dc0d43b45a0232bff8be.zip |
udhcpc: support for -O <option>.
Two important notes:
* nissrv and nisdomain are not requested by default anymore!
* inconsistency between "XXXsvr" and "XXsrv" in option names resolved,
all are "XXXsrv" now.
function old new delta
udhcpc_main 2494 2600 +106
packed_usage 23023 23067 +44
add_requests 91 119 +28
static.udhcpc_longopts 209 226 +17
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 4/0 up/down: 195/0) Total: 195 bytes
Diffstat (limited to 'networking/udhcp/clientpacket.c')
-rw-r--r-- | networking/udhcp/clientpacket.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/networking/udhcp/clientpacket.c b/networking/udhcp/clientpacket.c index 406fe340a..54f3f0e49 100644 --- a/networking/udhcp/clientpacket.c +++ b/networking/udhcp/clientpacket.c | |||
@@ -57,13 +57,18 @@ static void init_packet(struct dhcpMessage *packet, char type) | |||
57 | * goes towards the head of the packet. */ | 57 | * goes towards the head of the packet. */ |
58 | static void add_requests(struct dhcpMessage *packet) | 58 | static void add_requests(struct dhcpMessage *packet) |
59 | { | 59 | { |
60 | uint8_t c; | ||
60 | int end = end_option(packet->options); | 61 | int end = end_option(packet->options); |
61 | int i, len = 0; | 62 | int i, len = 0; |
62 | 63 | ||
63 | packet->options[end + OPT_CODE] = DHCP_PARAM_REQ; | 64 | packet->options[end + OPT_CODE] = DHCP_PARAM_REQ; |
64 | for (i = 0; dhcp_options[i].code; i++) | 65 | for (i = 0; (c = dhcp_options[i].code) != 0; i++) { |
65 | if (dhcp_options[i].flags & OPTION_REQ) | 66 | if (dhcp_options[i].flags & OPTION_REQ |
66 | packet->options[end + OPT_DATA + len++] = dhcp_options[i].code; | 67 | || (client_config.opt_mask[c >> 3] & (1 << (c & 7))) |
68 | ) { | ||
69 | packet->options[end + OPT_DATA + len++] = c; | ||
70 | } | ||
71 | } | ||
67 | packet->options[end + OPT_LEN] = len; | 72 | packet->options[end + OPT_LEN] = len; |
68 | packet->options[end + OPT_DATA + len] = DHCP_END; | 73 | packet->options[end + OPT_DATA + len] = DHCP_END; |
69 | 74 | ||