Am 01/23/17 um 00:34 schrieb Jeremie Courreges-Anglas:
> Stuart Henderson <s...@spacehopper.org> writes:
> 
>>
>> Here is the upstream code with more context.
>>
>>  789         /*
>>  790          * Set the target address we're sending to.
>>  791          * Enforce the scope ID for bogus BSDs.
>>  792          */
>>  793         memcpy(&dst, to, sizeof(dst));
>>  794         m.msg_name = &dst;
>>  795         m.msg_namelen = sizeof(dst);
>>  796         ifindex = if_nametoindex(interface->name);
>>  797         if (no_global_v6_socket)
>>  798                 dst.sin6_scope_id = ifindex;
>>
>> So, setting the scope ID is exactly what they are already trying to do.
>> I don't really want to spend much time understanding code which they
>> have marked as "XXX: this is gross. we need to go back and overhaul the
>> API for socket handling". But it looks like they'd be expecting
>> no_global_v6_socket to be set on a BSD which needs the scope id.
> 
> Whether no_global_v6_socket is true doesn't seem to depend on the OS: it
> appears true when running dhclient, false when running dhcpd/dhcrelay;
> see if_register_linklocal6().  This looks more like a lack of testing,
> as it appears safe to set sin6_scope_id everywhere.
> 
>> Better if someone who already knows the code looks at it - can you
>> bring this up on dhcp-users or somewhere similar?
> 
> I don't volunteer to move this to dhcp-users... yet.  Maybe the actual
> fix is in our base system.  It *looks like* our kernel has indeed a bug,
> it should use the ifindex in the cmsg.
> 

Ok, i already prepared a mail i was going to send later today, but if
the bug is in our base system, it won't do any good.

Maybe someone with knowledge of the network stack can have a look? I
would help in testing patches.

Reply via email to