bisdn / meta-switch

MIT License
4 stars 2 forks source link

v5.1.x: libnl: ignore flags and weight of nexthops when doing a strict route … #201

Closed KanjiMonster closed 2 months ago

KanjiMonster commented 2 months ago

…comparison

When a route is created while the interface has no link, we get a notification with the route and the nexthop having the flag LINKDOWN.

If the interface later gets a link, we do not get a route notification about it, so the route and nexthop stay at LINKDOWN in the libnl cache.

If the route then gets removed again, the to be removed route will not have the LINKDOWN flag anymore, which then can break comparison of the nexthop(s).

So add a new helper for ignoring FLAGS and WEIGHT for nexthops, and use it everywhere we want to tell if it's the same nexthop, but not necessarily in the same state.

This fixes spurious missed route updates when the old object wasn't found.

Signed-off-by: Jonas Gorski jonas.gorski@bisdn.de (cherry picked from commit ef261196ac169961d941fdc51269dd47e52a9375)