[PATCH] babel: Set onlink flag for IPv4 routes with unreachable next hop
If the next hop of a route is not a reachable address, the route should be installed as onlink. This enables a configuration common in mesh networks where the mesh interface is assigned a /32 and babel handles the routing by installing onlink routes. Signed-off-by: Toke Høiland-Jørgensen <toke@toke.dk> --- proto/babel/babel.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/proto/babel/babel.c b/proto/babel/babel.c index 88c4711e..4fd88042 100644 --- a/proto/babel/babel.c +++ b/proto/babel/babel.c @@ -640,6 +640,13 @@ babel_announce_rte(struct babel_proto *p, struct babel_entry *e) .nh.iface = r->neigh->ifa->iface, }; + /* If we cannot find a reachable neighbour, set the entry to be onlink. This + * makes it possible to, e.g., assign /32 addresses on a mesh interface and + * have routing work. + */ + if (!neigh_find2(&p->p, &r->next_hop, r->neigh->ifa->iface, 0)) + a0.nh.flags = RNF_ONLINK; + rta *a = rta_lookup(&a0); rte *rte = rte_get_temp(a); rte->u.babel.seqno = r->seqno; -- 2.17.0
Toke Høiland-Jørgensen <toke@toke.dk> writes:
If the next hop of a route is not a reachable address, the route should be installed as onlink. This enables a configuration common in mesh networks where the mesh interface is assigned a /32 and babel handles the routing by installing onlink routes.
Any feedback on this? :) -Toke
On Mon, May 07, 2018 at 08:57:43PM +0200, Toke Høiland-Jørgensen wrote:
Toke Høiland-Jørgensen <toke@toke.dk> writes:
If the next hop of a route is not a reachable address, the route should be installed as onlink. This enables a configuration common in mesh networks where the mesh interface is assigned a /32 and babel handles the routing by installing onlink routes.
Any feedback on this? :)
Hi There are some minor issues (like there should be check for error values from neigh_find2()), but that can i fix. I just wonder whether we would want this behavior as a default or whether it should be configurable. What do you think? -- Elen sila lumenn' omentielvo Ondrej 'Santiago' Zajicek (email: santiago@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."
Ondrej Zajicek <santiago@crfreenet.org> writes:
On Mon, May 07, 2018 at 08:57:43PM +0200, Toke Høiland-Jørgensen wrote:
Toke Høiland-Jørgensen <toke@toke.dk> writes:
If the next hop of a route is not a reachable address, the route should be installed as onlink. This enables a configuration common in mesh networks where the mesh interface is assigned a /32 and babel handles the routing by installing onlink routes.
Any feedback on this? :)
Hi
There are some minor issues (like there should be check for error values from neigh_find2()), but that can i fix. I just wonder whether we would want this behavior as a default or whether it should be configurable. What do you think?
Well, always-on matches what babeld does, that's why I went with that. Is there a case where this is not desirable behaviour? -Toke
On 15:30 09.05.18, Toke Høiland-Jørgensen wrote:
Ondrej Zajicek <santiago@crfreenet.org> writes:
There are some minor issues (like there should be check for error values from neigh_find2()), but that can i fix. I just wonder whether we would want this behavior as a default or whether it should be configurable. What do you think?
Well, always-on matches what babeld does, that's why I went with that. Is there a case where this is not desirable behaviour?
I would also like to see this get accepted into bird. I've been using the patch that Toke proposed (and thats available on [OpenWRT's tree]) without issues.
From my perspective there is no need to make this configurable. It is indeed what I would expect as default.
Is there anything besides the error handling that should be changed? The linked patchset is also rebased. I am happy to resubmit it, if needed. Regards, Andi [OpenWRT's tree]: https://github.com/openwrt-routing/packages/blob/37f8c509e03de355a3d0f9b6d62...
participants (3)
-
Andreas Rammhold -
Ondrej Zajicek -
Toke Høiland-Jørgensen