From 64d58aa8061c7c848cf0fd37de3ccbb8582d0fc5 Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Mon, 27 Mar 2017 22:22:09 +0200 Subject: udhcp6: fix problems found running against dnsmasq Patch is based on work by tiggerswelt.net. They say: " But when we tried to use dnsmasq on server-side, udhcpc6 was unable to forward the acquired address to its setup-script although the IPv6-Address had been assigned by the server as we could see via tcpdump. We traced this issue down to a problem on how udhcpc6 parses DHCPv6-Options: When moving to next option, a pointer-address is increased and a length buffer is decreased by the length of the option. The problem is that it is done in this order: option += 4 + option[3]; len_m4 -= 4 + option[3]; But this has to be switched as the length is decreased by the length of the *next* option, not the current one. This affected both - internal checks if a required option is present and the function to expose options to the environment of the setup-script. There was also a bug parsing D6_OPT_STATUS_CODE Options, that made dnsmasq not work as udhcpc6 thought it is receiving a non-positive status-code (because it did not parse the status-code as required in RFC 3315). In addition we introduced basic support for RFC 3646 (OPTION_DNS_SERVERS and OPTION_DOMAIN_LIST) and RFC 4704 (OPTION_CLIENT_FQDN). " Signed-off-by: Denys Vlasenko --- networking/udhcp/d6_common.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'networking/udhcp/d6_common.h') diff --git a/networking/udhcp/d6_common.h b/networking/udhcp/d6_common.h index f7cfa4a..335a092 100644 --- a/networking/udhcp/d6_common.h +++ b/networking/udhcp/d6_common.h @@ -81,9 +81,14 @@ struct d6_option { #define D6_OPT_RECONF_MSG 19 #define D6_OPT_RECONF_ACCEPT 20 +#define D6_OPT_DNS_SERVERS 23 +#define D6_OPT_DOMAIN_LIST 24 + #define D6_OPT_IA_PD 25 #define D6_OPT_IAPREFIX 26 +#define D6_OPT_CLIENT_FQDN 39 + /*** Other shared functions ***/ struct client6_data_t { -- cgit v1.1