clean dns list if an interface is marked as down
[project/netifd.git] / interface.c
index 37b20cc..0a85e6f 100644 (file)
@@ -85,6 +85,7 @@ interface_event(struct interface *iface, enum interface_event ev)
 static void
 mark_interface_down(struct interface *iface)
 {
+       interface_clear_dns(iface);
        vlist_flush_all(&iface->proto_addr);
        vlist_flush_all(&iface->proto_route);
        if (iface->main_dev.dev)
@@ -250,6 +251,8 @@ interface_proto_cb(struct interface_proto_state *state, enum interface_proto_eve
 
                mark_interface_down(iface);
                interface_handle_config_change(iface);
+               if (iface->autostart)
+                       __interface_set_up(iface);
                break;
        case IFPEV_LINK_LOST:
                if (iface->state != IFS_UP)