Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame^] | 1 | From deb3a2c51f32e0d2741be11a492e727129f770e2 Mon Sep 17 00:00:00 2001 |
| 2 | From: Nate Karstens <nate.karstens@garmin.com> |
| 3 | Date: Wed, 28 Jun 2017 17:30:00 -0500 |
| 4 | Subject: [PATCH 3/8] Track interface socket family |
| 5 | |
| 6 | Tracks the socket family associated with the interface. |
| 7 | |
| 8 | Upstream-Status: Submitted [dts@apple.com] |
| 9 | |
| 10 | Signed-off-by: Nate Karstens <nate.karstens@garmin.com> |
| 11 | Signed-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 | |
| 17 | diff --git a/mDNSPosix/mDNSPosix.c b/mDNSPosix/mDNSPosix.c |
| 18 | index 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; |
| 29 | diff --git a/mDNSPosix/mDNSPosix.h b/mDNSPosix/mDNSPosix.h |
| 30 | index 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 | -- |
| 50 | 2.35.1 |
| 51 | |