[PATCH master] IPv6 ECMP support fixes for linux

Ondrej Zajicek santiago at crfreenet.org
Wed Feb 17 16:34:18 CET 2016


On Wed, Feb 17, 2016 at 02:59:12PM +0100, Mikhail Sennikovskii wrote:
> Hi,

Hi

Thanks for a quick response.

> 2) Function krt_replace_rte() should be smarter than just flushing the
> > whole old multipath rte. It should compare old and new next hops (we
> > could suppose they are sorted) and either add missing
> 
> I'm not sure for now whether it's possible to make this work,
> as netlink returns EEXIST whenever one tries to add a route for the network,
> already present in the routing table.
> This is why removing and re-installing seemed the best solution for me.

There is a flag (NLM_F_EXCL) that control such behavior. So, BIRD should use
this flag in single path case or if there is no other, but should not when
adding additional  next hops to multipath rte.

> >
> > 4) Also rt_merge_list() uses mpnh_merge_rta() which uses rte_update_pool.
> > That is probably not safe outside of nest update code. The linux netlink
> > code should have its own linpool (static and shared, because netlink socket
> > is also shared), so you could allocate mpnh structures from it. The linpool
> > should be flushed when the route is collected and propagated to
> > krt_got_route().
> > So you don't need to do rta_lookup() for temporary next hops.
> >
> Right, will do.

I noticed later that nl_parse_route() allocates some other route
attributes by alloca(), so naive collecting without rta_lookup() will not
work. Probably just replace these alloca() with lp_alloc().

> > What is problematic is handling asynchronous notifications (because you
> > don't know inside netlink code what are other next hops and whether you
> > will get another one related to the same net).
> >
> Sorry, I guess I just mixed up with bird terminology.
> I thought the learn mode is directly related to handling these asynchronous
> notifications and adjusting the bird routes set accordingly.

These are two separate things. Learn mode is whether BIRD learn alien
routes from kernel table back to BIRD or just ignore them. BIRD uses both
periodic scans and asynchronous notifications to monitor kernel routing
table for both bird route changes and alien route changes.

-- 
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