diff options
author | Felix Fietkau <nbd@nbd.name> | 2018-03-13 13:05:28 +0100 |
---|---|---|
committer | Felix Fietkau <nbd@nbd.name> | 2018-03-13 13:06:38 +0100 |
commit | 69aeaabcfb62d1821275cd0c076ef557c6814c51 (patch) | |
tree | a30a604c64f5c5372293b994b75ec8b06e13f480 /interface-ip.c | |
parent | c06f84238952211b35c2940a82fcce3fcc3221c1 (diff) |
interface-ip: fix route selection for host dependencies
In order to find the best match, allow overriding the last found entry
if route->mask for the new entry is bigger than the one from the previous
entry.
Patch submitted by 'Mikael' in FS#1358
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Diffstat (limited to 'interface-ip.c')
-rw-r--r-- | interface-ip.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/interface-ip.c b/interface-ip.c index 6ccc03e..4a3e2c0 100644 --- a/interface-ip.c +++ b/interface-ip.c @@ -204,7 +204,7 @@ __find_ip_route_target(struct interface_ip_settings *ip, union if_addr *a, if (route->flags & DEVROUTE_TABLE) continue; - if (!*res || route->mask < (*res)->mask) + if (!*res || route->mask > (*res)->mask) *res = route; } } |