Exporting multipath link routes from Linux kernel

Ondrej Zajicek santiago at crfreenet.org
Mon Jan 21 23:04:15 CET 2019

On Mon, Jan 21, 2019 at 10:01:54PM +0100, Eugene Crosser wrote:
> On 21/01/2019 21:20, Ondrej Zajicek wrote:
> >> https://gitlab.labs.nic.cz/labs/bird/blob/master/sysdep/linux/netlink.c#L528
> >>
> >> Questions:
> >>
> >> 1. What was the justification for disallowing gateway-less multipath
> >> routes? Would it make sense to allow them (in the mainstream code)?
> > 
> > The code differentiated between gateway and gateway-less routes based on
> > rta->dest (RTD_ROUTER for gateway, RTD_DEVICE for gateway-less). We
> > extended that to have RTD_MULTIPATH, but there was no separate dest for
> > each nexthop, so we restricted it to have all nexthops with gateways.
> > Also, ECMP routes generated by protocols (e.g. OSPF) are always with
> > nexthops, so it was generally not a big limitation.
> > 
> > In BIRD 2.0, we unified this, replaced RTD_ROUTER / RTD_DEVICE /
> > RTD_MULTIPATH with RTD_UNICAST, which can handle ECMP routes with mixed
> > gateway and gatewa-less nexthops.
> > 
> > 
> >> 2. Would it be sufficient to simply drop the check for the presence of
> >> the gateway address in the message, and return `first` even if gateway
> >> address was not present?
> > 
> > Not sure what you mean by `first`. You cannot read RTA_GATEWAY field if
> I was referring to the variable name in the code that I linked to.

If you just returned 'first' without filling rv->gw, you would end with
nexthop with undefined/random gateway address, as it was not properly set

I suggesetd to replace 'return NULL;' in the else branch with 'rv->gw = IPA_NONE;'.

> I was looking at the code in the master branch, I assumed that it is 2.x?

Not yet, see: https://bird.network.cz/pipermail/bird-users/2019-January/013006.html

Elen sila lumenn' omentielvo

Ondrej 'Santiago' Zajicek (email: santiago at crfreenet.org)
OpenPGP encrypted e-mails preferred (KeyID 0x11DEADC3, wwwkeys.pgp.net)
"To err is human -- to blame it on a computer is even more so."

More information about the Bird-users mailing list