ip: do not add local routes for host dependencies
authorFelix Fietkau <nbd@nbd.name>
Wed, 7 Mar 2018 22:14:57 +0000 (23:14 +0100)
committerFelix Fietkau <nbd@nbd.name>
Wed, 7 Mar 2018 22:15:12 +0000 (23:15 +0100)
This avoids creating invalid routes in cases where another daemon is
handling local routes for an interface, e.g. on mesh interfaces

Signed-off-by: Felix Fietkau <nbd@nbd.name>
interface-ip.c

index dcf3390..6ccc03e 100644 (file)
@@ -262,6 +262,7 @@ interface_ip_add_target_route(union if_addr *addr, bool v6, struct interface *if
                }
        }
 
+done:
        if (!r_next) {
                free(route);
                return NULL;
@@ -272,8 +273,6 @@ interface_ip_add_target_route(union if_addr *addr, bool v6, struct interface *if
        route->mtu = r_next->mtu;
        route->metric = r_next->metric;
        route->table = r_next->table;
-
-done:
        route->iface = iface;
        if (defaultroute_target)
                free(route);