system-linux: fix a glob related memleak
[project/netifd.git] / interface-event.c
index 82c274d..24af8f5 100644 (file)
@@ -30,7 +30,7 @@ static void task_complete(struct uloop_process *proc, int ret);
 static struct uloop_process task = {
        .cb = task_complete,
 };
-char *eventnames[] = {"ifdown", "ifup", "ifupdate"};
+static const char * const eventnames[] = {"ifdown", "ifup", "ifupdate"};
 
 static void
 run_cmd(const char *ifname, const char *device, enum interface_event event,
@@ -83,7 +83,7 @@ call_hotplug(void)
        current_ev = current->hotplug_ev;
        list_del_init(&current->hotplug_list);
 
-       if (current_ev == IFEV_UP && current->l3_dev.dev)
+       if ((current_ev == IFEV_UP || current_ev == IFEV_UPDATE) && current->l3_dev.dev)
                device = current->l3_dev.dev->ifname;
 
        D(SYSTEM, "Call hotplug handler for interface '%s', event '%s' (%s)\n",