properly flush routes and l3 devices when tearing down interfaces
[project/netifd.git] / interface.c
index 4d9aa8a..4ad89f5 100644 (file)
@@ -120,6 +120,8 @@ __interface_set_down(struct interface *iface, bool force)
        if (iface->state == IFS_UP)
                interface_event(iface, IFEV_DOWN);
        iface->state = IFS_TEARDOWN;
+       interface_ip_flush(&iface->config_ip);
+       interface_ip_flush(&iface->proto_ip);
        interface_proto_event(iface->proto, PROTO_CMD_TEARDOWN, force);
        if (force)
                interface_flush_state(iface);