maybHi, I've been using BusyBox 1.34.1 for IPv6 stuff. I noticed that the DHCPv6 RELEASE does not include the client ID option (required by RFC8415, sec. 18.2.7), even though there is code to do it in send_d6_release:
/* Client-id */ ci = udhcp_find_option(client_data.options, D6_OPT_CLIENTID); if (ci) opt_ptr = mempcpy(opt_ptr, ci->data, D6_OPT_DATA + 2+2 + 6); When udhcpc6 first starts, it creates its own client ID option if none is provided, so it *should* be there: clientid_mac_ptr = NULL; if (!udhcp_find_option(client_data.options, D6_OPT_CLIENTID)) { /* not set, set the default client ID */ clientid_mac_ptr = udhcp_insert_new_option( &client_data.options, D6_OPT_CLIENTID, 2+2 + 6, /*dhcp6:*/ 1); clientid_mac_ptr += 2+2; /* skip option code, len */ clientid_mac_ptr[1] = 3; /* DUID-LL */ clientid_mac_ptr[3] = 1; /* type: ethernet */ clientid_mac_ptr += 2+2; /* skip DUID-LL, ethernet */ } I found that even if I insert another udhcp_find_option after the udhcp_insert_new_option call, the just-now-added option is *still* not found. I think it is due to an issue with the OPT_CODE handling. D6_OPT_CLIENTID is 1, so it fits within a single byte but nonetheless, the following occurs: * udhcp_insert_new_option treats code for IPv6 as follows: new->data[D6_OPT_CODE] = code >> 8; new->data[D6_OPT_CODE + 1] = code & 0xff; * udhcp_find_option tests the code as follows: while (opt_list && opt_list->data[OPT_CODE] < code) ... if (opt_list && opt_list->data[OPT_CODE] == code) So yes, OPT_CODE and D6_OPT_CODE are both 0, but the D6_OPT_CLIENTID = 1 value means that the 1 is in the seconds byte, and udhcp_find_option is only looking at the first byte, So the send_d6_release can never find it the created option. Maybe udhcp_find_option needs a "bool dhcpv6" arg just like udhcp_insert_new_option, or else maybe there needs to be a udhcp_find_option6 option? Danomi - _______________________________________________ busybox mailing list busybox@busybox.net http://lists.busybox.net/mailman/listinfo/busybox