On Wed, Dec 14, 2022 at 8:55 AM Nicolas Cavallari
<nicolas.cavall...@green-communications.fr> wrote:
>
> On 14/12/2022 00:47, Denys Vlasenko wrote:
> > On Tue, Dec 13, 2022 at 4:58 PM John Lemonovich
> > <john.lemonov...@foresys.com> wrote:
> >>
> >> Thanks for the replies.  Yes David, it's also my understanding per the 
> >> spec, that the client's link-local address must be included for the 
> >> solicit message.
> >
> > Where does it say that in https://www.rfc-editor.org/rfc/rfc3315 ?
>
> 1.1. Protocols and Addressing
>
>     Clients and servers exchange DHCP messages using UDP [15].  The
>     client uses a link-local address or addresses determined through
>     other mechanisms for transmitting and receiving DHCP messages.
>
> Also, RFC 3315 is obsoleted by RFC 8415, but the wording is the same in
> section 5.

Looking at the code.
d6_send_raw_packet_from_client_data_ifindex() fills in
source address like this:

d6_send_raw_packet_from_client_data_ifindex(
                packet, (end - (uint8_t*) packet),
                /*src*/ &client6_data.ll_ip6, CLIENT_PORT6,
... &client6_data.ll_ip6 is passed as "src_ipv6" parameter into it, and...
       if (src_ipv6)
                packet.ip6.ip6_src = *src_ipv6; /* struct copy */
it is used as above.

client6_data.ll_ip6 is populated by periodic calls to
d6_read_interface(...&client6_data.ll_ip6,...)
which looks at all addresses and should be finding
our link-local address, if it exists:

int FAST_FUNC d6_read_interface(
                const char *interface,
                int *ifindex,
                struct in6_addr *nip6,
                uint8_t *mac)
...
        getifaddrs(&ifap);
        for (ifa = ifap; ifa; ifa = ifa->ifa_next) {
                struct sockaddr_in6 *sip6;
                if (!ifa->ifa_addr || (strcmp(ifa->ifa_name, interface) != 0))
                        continue;
...
                sip6 = (void*)(ifa->ifa_addr);
                if (ifa->ifa_addr->sa_family == AF_INET6
                 && IN6_IS_ADDR_LINKLOCAL(&sip6->sin6_addr)
                ) {
                        *nip6 = sip6->sin6_addr; /* struct copy */
                        log1(
                                "IPv6
%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x",
                                nip6->s6_addr[0], nip6->s6_addr[1],
                                nip6->s6_addr[2], nip6->s6_addr[3],
                                nip6->s6_addr[4], nip6->s6_addr[5],
                                nip6->s6_addr[6], nip6->s6_addr[7],
                                nip6->s6_addr[8], nip6->s6_addr[9],
                                nip6->s6_addr[10], nip6->s6_addr[11],
                                nip6->s6_addr[12], nip6->s6_addr[13],
                                nip6->s6_addr[14], nip6->s6_addr[15]
                        );
                        retval &= (3 - (1<<1));
                }

Do you reach this code? You can know it if you
enabled logging at least to level 1 (udhcpc6 -v) and you see
"IPv6 xx:xx:xx:...:xx" message.
_______________________________________________
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox

Reply via email to