blob: 8c0e6bf3976a16a02815e63599a827b348aa05cd [file] [log] [blame]
Andrew Geissler82c905d2020-04-13 13:39:40 -05001From 71a7c728ae0d8143b66aa40decca74ebaa9aa2ce 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 03/11] 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>
11---
12 mDNSPosix/mDNSPosix.c | 1 +
13 mDNSPosix/mDNSPosix.h | 2 ++
14 2 files changed, 3 insertions(+)
15
16diff --git a/mDNSPosix/mDNSPosix.c b/mDNSPosix/mDNSPosix.c
17index 5e5b2cd..8fe22be 100644
18--- a/mDNSPosix/mDNSPosix.c
19+++ b/mDNSPosix/mDNSPosix.c
20@@ -918,6 +918,7 @@ mDNSlocal int SetupOneInterface(mDNS *const m, struct sockaddr *intfAddr, struct
21 // Set up the extra fields in PosixNetworkInterface.
22 assert(intf->intfName != NULL); // intf->intfName already set up above
23 intf->index = intfIndex;
24+ intf->sa_family = intfAddr->sa_family;
25 intf->multicastSocket4 = -1;
26 #if HAVE_IPV6
27 intf->multicastSocket6 = -1;
28diff --git a/mDNSPosix/mDNSPosix.h b/mDNSPosix/mDNSPosix.h
29index ca60d80..f77c185 100644
30--- a/mDNSPosix/mDNSPosix.h
31+++ b/mDNSPosix/mDNSPosix.h
32@@ -19,6 +19,7 @@
33 #define __mDNSPlatformPosix_h
34
35 #include <signal.h>
36+#include <sys/socket.h>
37 #include <sys/time.h>
38
39 #ifdef __cplusplus
40@@ -40,6 +41,7 @@ struct PosixNetworkInterface
41 const char * intfName;
42 PosixNetworkInterface * aliasIntf;
43 int index;
44+ sa_family_t sa_family;
45 int multicastSocket4;
46 #if HAVE_IPV6
47 int multicastSocket6;
48--
492.17.1
50