changeset 4257:29971caaafc9 draft

Linux: If listening to dev manager, let it remove interfaces Otherwise we race with the kernel removing and the dev manager re-adding it.
author Roy Marples <roy@marples.name>
date Mon, 16 Apr 2018 09:23:30 +0000
parents 4cc5f8d94727
children f7795e713bf5
files src/if-linux.c
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/if-linux.c	Mon Apr 16 09:37:04 2018 +0100
+++ b/src/if-linux.c	Mon Apr 16 09:23:30 2018 +0000
@@ -753,7 +753,10 @@
 	}
 
 	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;
 	}