From: zmw12306 Date: Sat, 5 Apr 2025 18:00:41 +0000 (-0400) Subject: babeld: Request forwarding does not prioritize feasible routes X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=49f6e9a38567c39ddc1f5b139790dd655b2a4d06;p=matthieu%2Ffrr.git babeld: Request forwarding does not prioritize feasible routes Modify route selection to check feasibility first, then fall back to non-feasible routes as per SHOULD requirement. Signed-off-by: zmw12306 --- diff --git a/babeld/message.c b/babeld/message.c index 5a33d5c288..40e2d20ee0 100644 --- a/babeld/message.c +++ b/babeld/message.c @@ -1905,8 +1905,14 @@ handle_request(struct neighbour *neigh, const unsigned char *prefix, /* We were about to forward a request to its requestor. Try to find a different neighbour to forward the request to. */ struct babel_route *other_route; + /* First try feasible routes as required by RFC */ + other_route = find_best_route(prefix, plen, 1, neigh); - other_route = find_best_route(prefix, plen, 0, neigh); + if(!other_route || route_metric(other_route) >= INFINITY) { + /* If no feasible route found, try non-feasible routes */ + other_route = find_best_route(prefix, plen, 0, neigh); + } + if(other_route && route_metric(other_route) < INFINITY) successor = other_route->neigh; }