Fix IPv6 ECMP handling with 4.11+ kernel

Vincent Bernat bernat at luffy.cx
Thu Aug 31 22:39:01 CEST 2017


Hey!

Starting from kernel 4.11 (commit beb1afac518d), IPv6 are now notified
using RTA_MULTIPATH, like IPv4 routes. Those routes are not handled
correctly by BIRD. We handle them correctly. This also enable to parse
alien routes correctly. Route modifications is still done in the old
way as for insertion/deletion, this is not helpful to optimize in those
cases and for replace, IPv4 case is not optimized either. It should be
possible to detect appropriate support for RTA_MULTIPATH when receiving
an IPv6 route with this attribute, but I don't see how it would be
helpful, so I didn't do it (simpler code this way).

I did some quick tests and routes are removed/added correctly:

Deleted 2001:db8:a3::/64 proto bird metric 1024
        nexthop via 2001:db8:ff::5  dev vti5 weight 1
        nexthop via 2001:db8:ff::7  dev vti6 weight 1
2001:db8:a3::/64 via 2001:db8:ff::7 dev vti6 proto bird metric 1024  pref medium

Deleted 2001:db8:a3::/64 via 2001:db8:ff::7 dev vti6 proto bird metric 1024  pref medium
2001:db8:a3::/64 via 2001:db8:ff::5 dev vti5 proto bird metric 1024  pref medium
2001:db8:a3::/64 proto bird metric 1024
        nexthop via 2001:db8:ff::7  dev vti6 weight 1
        nexthop via 2001:db8:ff::5  dev vti5 weight 1

Also, alien routes are correctly parsed when next-hops are correctly
ordered (I didn't check if this restriction is also present for IPv4 or
if Linux is always sending IPv4 multipath routes with next-hops
correctly ordered):

2001:db8:a4::/64 metric 1024
        nexthop via 2001:db8:ff::5  dev vti5 weight 1
        nexthop via 2001:db8:ff::7  dev vti6 weight 1

2001:db8:a4::/64   multipath [kernel1 22:30:54] * (10)
        via 2001:db8:ff::5 on vti5 weight 1
        via 2001:db8:ff::7 on vti6 weight 1

I'll try to investigate that unless someone already knows the answer.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-KRT-Fix-IPv6-ECMP-with-4.11-kernels.patch
Type: text/x-diff
Size: 5512 bytes
Desc: not available
URL: <http://trubka.network.cz/pipermail/bird-users/attachments/20170831/cd29d321/attachment.patch>
-------------- next part --------------

-- 
Make input easy to proofread.
            - The Elements of Programming Style (Kernighan & Plauger)


More information about the Bird-users mailing list