1From deb3a2c51f32e0d2741be11a492e727129f770e2 Mon Sep 17 00:00:00 2001
2From: Nate Karstens <nate.karstens@garmin.com>
3Date: Wed, 28 Jun 2017 17:30:00 -0500
4Subject: [PATCH 3/8] Track interface socket family
5
6Tracks the socket family associated with the interface.
7
8Upstream-Status: Submitted [dts@apple.com]
9
10Signed-off-by: Nate Karstens <nate.karstens@garmin.com>
11Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
12---
13 mDNSPosix/mDNSPosix.c | 1 +
14 mDNSPosix/mDNSPosix.h | 2 ++
15 2 files changed, 3 insertions(+)
16
17Index: mDNSResponder/mDNSPosix/mDNSPosix.c
18===================================================================
19--- mDNSResponder.orig/mDNSPosix/mDNSPosix.c
20+++ mDNSResponder/mDNSPosix/mDNSPosix.c
21@@ -1415,6 +1415,7 @@ mDNSlocal int SetupOneInterface(mDNS *co
22         // Set up the extra fields in PosixNetworkInterface.
23         assert(intf->intfName != NULL);         // intf->intfName already set up above
24         intf->index                = intfIndex;
25+        intf->sa_family            = intfAddr->sa_family;
26         intf->multicastSocket4     = -1;
27 #if HAVE_IPV6
28         intf->multicastSocket6     = -1;
29Index: mDNSResponder/mDNSPosix/mDNSPosix.h
30===================================================================
31--- mDNSResponder.orig/mDNSPosix/mDNSPosix.h
32+++ mDNSResponder/mDNSPosix/mDNSPosix.h
33@@ -19,6 +19,7 @@
34 #define __mDNSPlatformPosix_h
35
36 #include <signal.h>
37+#include <sys/socket.h>
38 #include <sys/time.h>
39
40 #ifdef  __cplusplus
41@@ -40,6 +41,7 @@ struct PosixNetworkInterface
42     char *                  intfName;
43     PosixNetworkInterface * aliasIntf;
44     int index;
45+    sa_family_t sa_family;
46     int multicastSocket4;
47 #if HAVE_IPV6
48     int multicastSocket6;
49