router: fix previous commit
authorHans Dedecker <dedeckeh@gmail.com>
Fri, 16 Aug 2019 19:14:07 +0000 (21:14 +0200)
committerHans Dedecker <dedeckeh@gmail.com>
Fri, 16 Aug 2019 19:14:07 +0000 (21:14 +0200)
After closing the router socket the value needs to be set to -1

Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
src/router.c

index 85940f8a1b3d747a4dea92281dc49ed0ecaa82ba..f1471db59959d0e48d7a0e6e628c5055b8633862 100644 (file)
@@ -231,8 +231,10 @@ static void router_netevent_cb(unsigned long event, struct netevent_handler_info
        switch (event) {
        case NETEV_IFINDEX_CHANGE:
                iface = info->iface;
-               if (iface && iface->router_event.uloop.fd >= 0)
+               if (iface && iface->router_event.uloop.fd >= 0) {
                        close(iface->router_event.uloop.fd);
+                       iface->router_event.uloop.fd = -1;
+               }
                break;
        case NETEV_ROUTE6_ADD:
        case NETEV_ROUTE6_DEL: