add support for alias devices, which are activated based on hotplug events containing...
[project/netifd.git] / interface.c
index 0a2afd01702e9a659fa5fdb8ebecdc32fe20bf51..7c8a0c258eaabdb29d215750501140a08ef52c6a 100644 (file)
@@ -215,6 +215,7 @@ interface_cleanup(struct interface *iface)
        interface_clear_errors(iface);
        if (iface->main_dev.dev)
                device_remove_user(&iface->main_dev);
+       iface->l3_dev = &iface->main_dev;
        interface_set_proto_state(iface, NULL);
 }
 
@@ -280,6 +281,8 @@ interface_proto_cb(struct interface_proto_state *state, enum interface_proto_eve
                interface_handle_config_change(iface);
                if (iface->autostart)
                        __interface_set_up(iface);
+               if (iface->l3_dev->dev)
+                       device_release(iface->l3_dev);
                break;
        case IFPEV_LINK_LOST:
                if (iface->state != IFS_UP)