bisdn / basebox

A tiny OpenFlow controller for OF-DPA switches.
Mozilla Public License 2.0
45 stars 9 forks source link

nl_l3: keep IPv6LL route enabled if any interface still has it #443

Closed KanjiMonster closed 4 months ago

KanjiMonster commented 5 months ago

Currently we unconditionally delete the IPv6LL route when it get's deleted from the routing table. But this is a per-interface route, so just because one route is removed does not mean that there are none left.

So the following sequence

$ ip link set up port1
$ ip link set up port2
$ ip link set down port1

will result in the IPv6LL route being disabled, although port1 still has one.

So add a check on deletion if there are any remaining interfaces left with the IPv6LL route, and only actually delete it if there aren't any.

KanjiMonster commented 5 months ago

This is more a general issue than just IPv6(LL) and affects any duplicate routes, but with the default IPv6LL routes on each enabled interface this is where it crops up by default.

You have the same issue when assigning IP addresses from the same subnet to multiple interfaces, but a proper fix for that will require libnl changes.