}
if (node_old) {
- if (!(a_old->flags & DEVADDR_EXTERNAL) && a_old->enabled && !keep) {
- interface_handle_subnet_route(iface, a_old, false);
-
+ if (a_old->enabled && !keep) {
if ((a_old->flags & DEVADDR_FAMILY) == DEVADDR_INET6)
v6 = true;
a_old->mask, table, NULL, NULL);
}
- system_del_address(dev, a_old);
+ if (!(a_old->flags & DEVADDR_EXTERNAL)) {
+ interface_handle_subnet_route(iface, a_old, false);
+ system_del_address(dev, a_old);
+ }
}
free(a_old->pclass);
free(a_old);
if (node_new) {
a_new->enabled = true;
- if (!(a_new->flags & DEVADDR_EXTERNAL) && (!keep || replace)) {
- if (system_add_address(dev, a_new))
- a_new->failed = true;
+ if (!keep || replace) {
+ if (!(a_new->flags & DEVADDR_EXTERNAL)) {
+ if (system_add_address(dev, a_new))
+ a_new->failed = true;
+
+ if (iface->metric)
+ interface_handle_subnet_route(iface, a_new, true);
+ }
if (!keep) {
if ((a_new->flags & DEVADDR_FAMILY) == DEVADDR_INET6)
a_new->mask, table, NULL, NULL);
}
}
-
- if (iface->metric)
- interface_handle_subnet_route(iface, a_new, true);
}
}
}