tech-net archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: IPv6 problems.... (dhcpcd weirdness, rshd fails, etc.)
On 18 Nov 2025, at 08:43, Greg A. Woods <woods%planix.ca@localhost> wrote:
>
> At Sun, 16 Nov 2025 11:09:24 -0000 (UTC), mlelstv%serpens.de@localhost (Michael van Elst) wrote:
> Looks like a bug, the scope somehow gets lost and rshd cannot bind
>>
>> to an unscoped link local address (the scope references the interface).
>
> What does "scope" mean in this context? Isn't the scope whether it is
> link-local, site-local, or global, and isn't that inferred from the
> prefix? How can that get lost?
I suspect it's something like this:
server->server_address.sa.sa_family = AF_INET6;
server->server_address.sin6.sin6_addr = response->rr.data.aaaa;
if (IN6_IS_ADDR_LINKLOCAL(&sa1->sin6_addr)) {
address.sin6.sin6_scope_id = response->interface_index;
}
For link-local addresses, you have to set sin6_scope_id or else it doesn't know which interface to send the packet on, because link-local addresses are link-scoped. It's a confusing use of terminology, to say the least. The scope ID is just the interface index, not "link local" versus "site local" versus "global."
(The above code is using an mDNS query result, which should always have an interface index if it's from mDNS and not DNS.)
Home |
Main Index |
Thread Index |
Old Index