summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@nbd.name>2018-03-27 11:28:54 +0200
committerFelix Fietkau <nbd@nbd.name>2018-03-27 11:31:16 +0200
commit9c8d7816fc5e966b0c0efab9c1234734e0c5c254 (patch)
treeae3e1d015f9bf3c509df5f767c190bd2529b8a4c
parent69aeaabcfb62d1821275cd0c076ef557c6814c51 (diff)
downloadnetifd-9c8d7816fc5e966b0c0efab9c1234734e0c5c254.tar.gz
netifd: return the interface for locally addressable host dependencies (FS#1452)
Fixes an issue where interfaces with host dependencies that resolve to a local subnet stay down. Fixes: 1f5a29c3de6e ("ip: do not add local routes for host dependencies") Signed-off-by: Felix Fietkau <nbd@nbd.name>
-rw-r--r--interface-ip.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/interface-ip.c b/interface-ip.c
index 4a3e2c0..1c84d4f 100644
--- a/interface-ip.c
+++ b/interface-ip.c
@@ -245,7 +245,7 @@ interface_ip_add_target_route(union if_addr *addr, bool v6, struct interface *if
if (iface) {
/* look for locally addressable target first */
if (interface_ip_find_addr_target(iface, addr, v6))
- goto done;
+ return iface;
/* do not stop at the first route, let the lookup compare
* masks to find the best match */
@@ -254,7 +254,7 @@ interface_ip_add_target_route(union if_addr *addr, bool v6, struct interface *if
vlist_for_each_element(&interfaces, iface, node) {
/* look for locally addressable target first */
if (interface_ip_find_addr_target(iface, addr, v6))
- goto done;
+ return iface;
/* do not stop at the first route, let the lookup compare
* masks to find the best match */
@@ -262,7 +262,6 @@ interface_ip_add_target_route(union if_addr *addr, bool v6, struct interface *if
}
}
-done:
if (!r_next) {
free(route);
return NULL;