]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Linux: If listening to dev manager, let it remove interfaces
authorRoy Marples <roy@marples.name>
Mon, 16 Apr 2018 09:23:30 +0000 (09:23 +0000)
committerRoy Marples <roy@marples.name>
Mon, 16 Apr 2018 09:23:30 +0000 (09:23 +0000)
Otherwise we race with the kernel removing and the dev manager
re-adding it.

src/if-linux.c

index 21e333bf13657edc30b2df3c4709fe3fd53a61db..99bacfabec39ce266a232302d0a5198c75559ff7 100644 (file)
@@ -753,7 +753,10 @@ link_netlink(struct dhcpcd_ctx *ctx, struct interface *ifp,
        }
 
        if (nlm->nlmsg_type == RTM_DELLINK) {
-               dhcpcd_handleinterface(ctx, -1, ifn);
+               /* If are listening to a dev manager, let that remove
+                * the interface rather than the kernel. */
+               if (dev_listening(ctx) < 1)
+                       dhcpcd_handleinterface(ctx, -1, ifn);
                return 0;
        }