diff options
| author | Russ White <russ@riw.us> | 2025-04-08 10:52:08 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-04-08 10:52:08 -0400 |
| commit | 59b62ca788ef7d04be6af12e8d6af99203d5c75c (patch) | |
| tree | 55deb85555547fe1f238873ffbff787c541d4240 | |
| parent | 28d66ef7f12e82ac514a868b77e2a49c342a64e5 (diff) | |
| parent | 49f6e9a38567c39ddc1f5b139790dd655b2a4d06 (diff) | |
Merge pull request #18581 from zmw12306/request_forward
babeld: Request forwarding does not prioritize feasible routes
| -rw-r--r-- | babeld/message.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/babeld/message.c b/babeld/message.c index 6a09e6386b..b5027578d0 100644 --- a/babeld/message.c +++ b/babeld/message.c @@ -1933,8 +1933,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; } |
