1From 8ebfeaf55ab364a1e51a3438dfa9a742a01b8d36 Mon Sep 17 00:00:00 2001 2Message-ID: <8ebfeaf55ab364a1e51a3438dfa9a742a01b8d36.1687508149.git.stefan@agner.ch> 3In-Reply-To: <e136dcdcdd93ef32ada981e89c195905eb809eea.1687508149.git.stefan@agner.ch> 4References: <e136dcdcdd93ef32ada981e89c195905eb809eea.1687508149.git.stefan@agner.ch> 5From: Nate Karstens <[email protected]> 6Date: Wed, 9 Aug 2017 09:16:58 -0500 7Subject: [PATCH] Mark deleted interfaces as being changed 8 9Netlink notification handling ignores messages for deleted links, 10RTM_DELLINK. It does handle RTM_GETLINK. According to libnl docu- 11mentation (http://www.infradead.org/~tgr/libnl/doc/route.html) 12RTM_DELLINK can be sent by the kernel, but RTM_GETLINK cannot. 13There was likely a mixup in the original implementation, so this 14change replaces handling for RTM_GETLINK with RTM_DELLINK. 15 16Testing and Verification Instructions: 17 1. Use ip-link to add and remove a VLAN interface and verify 18 that mDNSResponder handles the deleted link. 19 20Upstream-Status: Submitted [[email protected]] 21 22Signed-off-by: Nate Karstens <[email protected]> 23Signed-off-by: Alex Kiernan <[email protected]> 24--- 25 mDNSPosix/mDNSPosix.c | 2 +- 26 1 file changed, 1 insertion(+), 1 deletion(-) 27 28diff --git a/mDNSPosix/mDNSPosix.c b/mDNSPosix/mDNSPosix.c 29index ad7000d..010f266 100644 30--- a/mDNSPosix/mDNSPosix.c 31+++ b/mDNSPosix/mDNSPosix.c 32@@ -1714,7 +1714,7 @@ mDNSlocal void ProcessRoutingNotification(int sd, GenLinkedList *change 33 #endif 34 35 // Process the NetLink message 36- if (pNLMsg->nlmsg_type == RTM_GETLINK || pNLMsg->nlmsg_type == RTM_NEWLINK) 37+ if (pNLMsg->nlmsg_type == RTM_DELLINK || pNLMsg->nlmsg_type == RTM_NEWLINK) 38 AddInterfaceIndexToList(changedInterfaces, ((struct ifinfomsg*) NLMSG_DATA(pNLMsg))->ifi_index); 39 else if (pNLMsg->nlmsg_type == RTM_DELADDR || pNLMsg->nlmsg_type == RTM_NEWADDR) 40 AddInterfaceIndexToList(changedInterfaces, ((struct ifaddrmsg*) NLMSG_DATA(pNLMsg))->ifa_index); 41-- 422.41.0 43 44