diff options
author | Denys Vlasenko | 2021-06-02 13:50:26 +0200 |
---|---|---|
committer | Denys Vlasenko | 2021-06-02 14:07:26 +0200 |
commit | 265fcddd08f22c99a2a419a1537c18f4d6d43e9f (patch) | |
tree | e1cfb7a18bb0887b95700a7417f88ff90883bfa3 /networking/udhcp/common.h | |
parent | 9659a8db1dd28bdf8659fdae5d097b6f48bd2736 (diff) | |
download | busybox-265fcddd08f22c99a2a419a1537c18f4d6d43e9f.zip busybox-265fcddd08f22c99a2a419a1537c18f4d6d43e9f.tar.gz |
udhcpc: include client-id option in DECLINEs, even if it's a custom -x 61:HEX option
client_data.vendorclass, .hostname and .fqdn probably need the same treatment:
just insert them into the list of -x opts, get rid of
if (client_data.vendorclass)
udhcp_add_binary_option(packet, client_data.vendorclass);
if (client_data.hostname)
udhcp_add_binary_option(packet, client_data.hostname);
if (client_data.fqdn)
udhcp_add_binary_option(packet, client_data.fqdn);
function old new delta
udhcp_insert_new_option - 166 +166
perform_release 171 207 +36
perform_d6_release 227 259 +32
udhcpc6_main 2558 2580 +22
init_d6_packet 103 84 -19
udhcpc_main 2585 2564 -21
attach_option 397 253 -144
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 3/3 up/down: 256/-184) Total: 72 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'networking/udhcp/common.h')
-rw-r--r-- | networking/udhcp/common.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/networking/udhcp/common.h b/networking/udhcp/common.h index cc0abd2..e5af628 100644 --- a/networking/udhcp/common.h +++ b/networking/udhcp/common.h @@ -319,6 +319,17 @@ void udhcp_dump_packet(struct dhcp_packet *packet) FAST_FUNC; /* 2nd param is "uint32_t*" */ int FAST_FUNC udhcp_str2nip(const char *str, void *arg); + +#if !ENABLE_UDHCPC6 +#define udhcp_insert_new_option(opt_list, code, buffer, length, dhcpv6) \ + udhcp_insert_new_option(opt_list, code, buffer, length) +#endif +void* FAST_FUNC udhcp_insert_new_option(struct option_set **opt_list, + unsigned code, + const void *buffer, + unsigned length, + bool dhcpv6); + /* 2nd param is "struct option_set**" */ #if !ENABLE_UDHCPC6 #define udhcp_str2optset(str, arg, optflags, option_strings, dhcpv6) \ |