Skip to content

Commit 88a965f

Browse files
committed
interface-ip: install routes after IPv6 prefix address setup
In interface_ip_set_enabled(), routes are currently installed after IP addresses are set up, but before IPv6 prefix addresses are set up. This prevents configured static IPv6 routes that have next hops set to addresses belonging to those prefixes from being installed during interface setup as the relevant netlink requests return -EHOSTUNREACH (No route to host). Fix by deferring route installation until after IPv6 prefix addresses are configured. Signed-off-by: Michał Kępień <michal@isc.org>
1 parent 3a78780 commit 88a965f

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

interface-ip.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1727,12 +1727,6 @@ void interface_ip_set_enabled(struct interface_ip_settings *ip, bool enabled)
17271727
addr->enabled = enabled;
17281728
}
17291729

1730-
vlist_for_each_element(&ip->route, route, node)
1731-
interface_ip_set_route_enabled(ip, route, enabled);
1732-
if (ip == &iface->proto_ip)
1733-
vlist_for_each_element(&iface->host_routes, route, node)
1734-
interface_ip_set_route_enabled(ip, route, enabled);
1735-
17361730
vlist_for_each_element(&ip->neighbor, neighbor, node) {
17371731
if (neighbor->enabled == enabled)
17381732
continue;
@@ -1753,6 +1747,12 @@ void interface_ip_set_enabled(struct interface_ip_settings *ip, bool enabled)
17531747
if (!strcmp(a->name, ip->iface->name))
17541748
interface_set_prefix_address(a, c, ip->iface, enabled);
17551749

1750+
vlist_for_each_element(&ip->route, route, node)
1751+
interface_ip_set_route_enabled(ip, route, enabled);
1752+
if (ip == &iface->proto_ip)
1753+
vlist_for_each_element(&iface->host_routes, route, node)
1754+
interface_ip_set_route_enabled(ip, route, enabled);
1755+
17561756
if (ip->iface->policy_rules_set != enabled &&
17571757
ip->iface->l3_dev.dev) {
17581758
if (ip->iface->l3_dev.dev->settings.ipv6) {

0 commit comments

Comments
 (0)