ref: 80f875fd9291b5357941c28cccd6b8aba373c181
parent: 57fc95de3c52ed71a6cd478ae495d2bcaeab7204
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Sun Jan 7 18:39:29 EST 2024
devip: no more wandering routes Before, it was possible to add routes before the interface existed. The routes would look for their interface lazily as the route was looked up, but this leads to all kinds of hard to explain behaviour when a interface goes away and the routes start wandering to a different interface on their own which they will stick to when a new interface comes up that would match the route better. Instead, we have routes always associated to their desination interface and remove the routes when the interface gets unbound. It is no longer possible to add routes for interfaces that do not exist. This is easier to reason about behaviour as well as allows us to get rid of canrlock(ifc) in findipifc(). All routes inside the routing tree are now by definition up-to-date (as long as we hold the routelock). Callers of v4lookup()/v6lookup() still should check if the ifcid of the interface still matches the route once they have acquired the interface lock.