diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2018-05-14 11:06:35 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2018-05-14 11:11:08 +0200 |
commit | 6027597fd1a1a9293818db4729625fff375bf907 (patch) | |
tree | a8a38d8459b6a87f0c2132a5c05c779d8c1f4eca /networking/udhcp/d6_dhcpc.c | |
parent | 30f4d52ed17112f4fa340afe3bcaf305eeed36d9 (diff) | |
download | busybox-w32-6027597fd1a1a9293818db4729625fff375bf907.tar.gz busybox-w32-6027597fd1a1a9293818db4729625fff375bf907.tar.bz2 busybox-w32-6027597fd1a1a9293818db4729625fff375bf907.zip |
udhcpc6: set -x options in request
Last foru commits:
function old new delta
option_to_env 621 791 +170
.rodata 168351 168505 +154
attach_option 431 506 +75
add_d6_client_options 112 167 +55
d6_option_strings 30 84 +54
udhcp_str2optset 644 660 +16
d6_optflags 12 20 +8
udhcpc6_main 2590 2596 +6
udhcpc_main 2648 2651 +3
read_optset 15 18 +3
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 10/0 up/down: 544/0) Total: 544 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'networking/udhcp/d6_dhcpc.c')
-rw-r--r-- | networking/udhcp/d6_dhcpc.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/networking/udhcp/d6_dhcpc.c b/networking/udhcp/d6_dhcpc.c index 85068721a..9e3ce8b1c 100644 --- a/networking/udhcp/d6_dhcpc.c +++ b/networking/udhcp/d6_dhcpc.c | |||
@@ -484,8 +484,10 @@ static uint8_t *init_d6_packet(struct d6_packet *packet, char type, uint32_t xid | |||
484 | 484 | ||
485 | static uint8_t *add_d6_client_options(uint8_t *ptr) | 485 | static uint8_t *add_d6_client_options(uint8_t *ptr) |
486 | { | 486 | { |
487 | struct option_set *curr; | ||
487 | uint8_t *start = ptr; | 488 | uint8_t *start = ptr; |
488 | unsigned option; | 489 | unsigned option; |
490 | uint16_t len; | ||
489 | 491 | ||
490 | ptr += 4; | 492 | ptr += 4; |
491 | for (option = 1; option < 256; option++) { | 493 | for (option = 1; option < 256; option++) { |
@@ -508,7 +510,12 @@ static uint8_t *add_d6_client_options(uint8_t *ptr) | |||
508 | ptr = mempcpy(ptr, &opt_fqdn_req, sizeof(opt_fqdn_req)); | 510 | ptr = mempcpy(ptr, &opt_fqdn_req, sizeof(opt_fqdn_req)); |
509 | #endif | 511 | #endif |
510 | /* Add -x options if any */ | 512 | /* Add -x options if any */ |
511 | //... | 513 | curr = client_config.options; |
514 | while (curr) { | ||
515 | len = (curr->data[D6_OPT_LEN] << 8) | curr->data[D6_OPT_LEN + 1]; | ||
516 | ptr = mempcpy(ptr, curr->data, D6_OPT_DATA + len); | ||
517 | curr = curr->next; | ||
518 | } | ||
512 | 519 | ||
513 | return ptr; | 520 | return ptr; |
514 | } | 521 | } |
@@ -1215,7 +1222,10 @@ int udhcpc6_main(int argc UNUSED_PARAM, char **argv) | |||
1215 | } | 1222 | } |
1216 | while (list_x) { | 1223 | while (list_x) { |
1217 | char *optstr = xstrdup(llist_pop(&list_x)); | 1224 | char *optstr = xstrdup(llist_pop(&list_x)); |
1218 | udhcp_str2optset(optstr, &client_config.options, d6_optflags, d6_option_strings); | 1225 | udhcp_str2optset(optstr, &client_config.options, |
1226 | d6_optflags, d6_option_strings, | ||
1227 | /*dhcpv6:*/ 1 | ||
1228 | ); | ||
1219 | free(optstr); | 1229 | free(optstr); |
1220 | } | 1230 | } |
1221 | 1231 | ||