wireless: add retry_setup_failed to status notification
[project/netifd.git] / interface-event.c
index cfbc15c..93da22b 100644 (file)
@@ -30,7 +30,14 @@ static void task_complete(struct uloop_process *proc, int ret);
 static struct uloop_process task = {
        .cb = task_complete,
 };
-static const char * const eventnames[] = {"ifdown", "ifup", "ifupdate"};
+static const char * const eventnames[] = {
+       [IFEV_DOWN] = "ifdown",
+       [IFEV_UP] = "ifup",
+       [IFEV_UPDATE] = "ifupdate",
+       [IFEV_FREE] = "free",
+       [IFEV_RELOAD] = "reload",
+       [IFEV_LINK_UP] = "iflink",
+};
 
 static void
 run_cmd(const char *ifname, const char *device, enum interface_event event,
@@ -117,6 +124,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)) {
@@ -178,6 +189,7 @@ static void interface_event_cb(struct interface_user *dep, struct interface *ifa
                               enum interface_event ev)
 {
        switch (ev) {
+               case IFEV_LINK_UP:
                case IFEV_UP:
                case IFEV_UPDATE:
                case IFEV_DOWN: