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