1From 542c1b2ce1dcc069cf848d11978c8b6ae5982b6e Mon Sep 17 00:00:00 2001
2Message-ID: <542c1b2ce1dcc069cf848d11978c8b6ae5982b6e.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, 28 Jun 2017 17:30:00 -0500
7Subject: [PATCH] Track interface socket family
8
9Tracks the socket family associated with the interface.
10
11Upstream-Status: Submitted [[email protected]]
12
13Signed-off-by: Nate Karstens <[email protected]>
14Signed-off-by: Alex Kiernan <[email protected]>
15---
16 mDNSPosix/mDNSPosix.c | 1 +
17 mDNSPosix/mDNSPosix.h | 2 ++
18 2 files changed, 3 insertions(+)
19
20diff --git a/mDNSPosix/mDNSPosix.c b/mDNSPosix/mDNSPosix.c
21index a32a880..9a5b4d7 100644
22--- a/mDNSPosix/mDNSPosix.c
23+++ b/mDNSPosix/mDNSPosix.c
24@@ -1415,6 +1415,7 @@ mDNSlocal int SetupOneInterface(mDNS *const m, struct sockaddr *intfAddr, struct
25         // Set up the extra fields in PosixNetworkInterface.
26         assert(intf->intfName != NULL);         // intf->intfName already set up above
27         intf->index                = intfIndex;
28+        intf->sa_family            = intfAddr->sa_family;
29         intf->multicastSocket4     = -1;
30 #if HAVE_IPV6
31         intf->multicastSocket6     = -1;
32diff --git a/mDNSPosix/mDNSPosix.h b/mDNSPosix/mDNSPosix.h
33index 9675591..dd7864c 100644
34--- a/mDNSPosix/mDNSPosix.h
35+++ b/mDNSPosix/mDNSPosix.h
36@@ -19,6 +19,7 @@
37 #define __mDNSPlatformPosix_h
38
39 #include <signal.h>
40+#include <sys/socket.h>
41 #include <sys/time.h>
42
43 #ifdef  __cplusplus
44@@ -40,6 +41,7 @@ struct PosixNetworkInterface
45     char *                  intfName;
46     PosixNetworkInterface * aliasIntf;
47     int index;
48+    sa_family_t sa_family;
49     int multicastSocket4;
50 #if HAVE_IPV6
51     int multicastSocket6;
52--
532.41.0
54
55