wireless: add support for disabling multicast-to-unicast per virtual interface
[project/netifd.git] / interface-event.c
index d370caec4c9b9d3b821c6f0fab9bc5ac45989abd..a40f6dc883d3a3654d73d0592cd7eb65c2a8de85 100644 (file)
@@ -33,10 +33,12 @@ static struct uloop_process task = {
 static const char * const eventnames[] = {
        [IFEV_DOWN] = "ifdown",
        [IFEV_UP] = "ifup",
+       [IFEV_UP_FAILED] = "ifup-failed",
        [IFEV_UPDATE] = "ifupdate",
        [IFEV_FREE] = "free",
        [IFEV_RELOAD] = "reload",
        [IFEV_LINK_UP] = "iflink",
+       [IFEV_CREATE] = "create",
 };
 
 static void
@@ -124,6 +126,10 @@ interface_queue_event(struct interface *iface, enum interface_event ev)
 
        netifd_ubus_interface_notify(iface, ev != IFEV_DOWN);
 
+       /* no hotplug.d calls for link up */
+       if (ev == IFEV_LINK_UP)
+               return;
+
        if (current == iface) {
                /* an event for iface is being processed */
                if (!list_empty(&iface->hotplug_list)) {
@@ -187,14 +193,16 @@ static void interface_event_cb(struct interface_user *dep, struct interface *ifa
        switch (ev) {
                case IFEV_LINK_UP:
                case IFEV_UP:
+               case IFEV_UP_FAILED:
                case IFEV_UPDATE:
                case IFEV_DOWN:
                        interface_queue_event(iface, ev);
                        break;
                case IFEV_FREE:
-               case IFEV_RELOAD:
                        interface_dequeue_event(iface);
                        break;
+               default:
+                       break;
        }
 }