Radv proto sending adverts on wrong interface

Daniel Gröber dxld at darkboxed.org
Sat Mar 11 06:28:58 CET 2023


Hi,

I'm using bird as a replacement for radvd since the latter has a
longstanding issue with sending adverts on unconfigured interfaces under
complex conditions.

Turns out bird has a similar issue :)

Looking at the code, when opening the socket for an interface in
radv_sk_open we set sk->iface as you'd expect, which should cause packets
to be sent directly via this interface.

However radv sends packets to the all-nodes multicasts address for periodic
adverts, see radv_send_ra. This then calls sk_send_to which (eventually)
calls sockaddr_fill6. Here rther we find this code:

    if (ifa && ipa_is_link_local(a))
      sa->sin6_scope_id = ifa->index;

This would seem to be the problem to me, since a=ff02::1 doesn't pass this
check so the sendmsg call goes out without the interface-index being
communicated to the kernel. It looks like that causes it to just pick a
random interface though I would expect it to just multicast this. Not sure
why that is but it's broken on our side either way.

I'd add a check here for whether the saddr is link-local too. That should
cover this case.

Any comments/objections?

Thanks,
--Daniel


More information about the Bird-users mailing list