-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
nl_l3: only route l3 neighs if we have a route for them
Make sure we do not add host entries for l3 neighs for which we do not have a route until we a route gets added, and drop the host entries again when the route gets removed. To do this, we need to start keeping track of all l3 neighs we currently handle. To make this easy, use a set, and reuse the nh_stub to store the neighbor information. Due to IPv6 LL addresses being a bit more complicated, and should never routable anyway, do not track them. To allow nh_stub to be used in a set, we need to make it comparable, so implement the < operator for it. Using this we can then determine the routability of a l3 neigh we add by asking the kernel for the route to it, then checking if it has a nexthop that exist on one of our interfaces. Only if this is true, add a host route for it and add it to the set of routed l3 neighbours, in all other cases add it to the set of unrouted l3 neighbours. Then when adding a route, add all currently unrouted l3 neighbors matching this route, and conversely, when removing a route remove all matching l3 neighbors that are currently routed. Fixes l3 neighbours learned on an additional on-link staying reachable after removing the on-link route. Signed-off-by: Jonas Gorski <jonas.gorski@bisdn.de>
- Loading branch information
1 parent
f7d92dd
commit 4719213
Showing
3 changed files
with
137 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters