blob: d2a9995ffa43b24b0081a1a6f70a76559446b66c [file] [log] [blame]
Andrew Geissler517393d2023-01-13 08:55:19 -06001From 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
17diff --git a/mDNSPosix/mDNSPosix.c b/mDNSPosix/mDNSPosix.c
18index a32a880c0ce5..9a5b4d7ea4cb 100644
19--- a/mDNSPosix/mDNSPosix.c
20+++ b/mDNSPosix/mDNSPosix.c
21@@ -1415,6 +1415,7 @@ mDNSlocal int SetupOneInterface(mDNS *const m, struct sockaddr *intfAddr, struct
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;
29diff --git a/mDNSPosix/mDNSPosix.h b/mDNSPosix/mDNSPosix.h
30index 9675591b0434..dd7864cd0d5e 100644
31--- a/mDNSPosix/mDNSPosix.h
32+++ b/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--
502.35.1
51