From 71a7c728ae0d8143b66aa40decca74ebaa9aa2ce Mon Sep 17 00:00:00 2001 From: Nate Karstens Date: Wed, 28 Jun 2017 17:30:00 -0500 Subject: [PATCH 03/11] Track interface socket family Tracks the socket family associated with the interface. Upstream-Status: Submitted [dts@apple.com] Signed-off-by: Nate Karstens --- mDNSPosix/mDNSPosix.c | 1 + mDNSPosix/mDNSPosix.h | 2 ++ 2 files changed, 3 insertions(+) diff --git a/mDNSPosix/mDNSPosix.c b/mDNSPosix/mDNSPosix.c index 5e5b2cd..8fe22be 100644 --- a/mDNSPosix/mDNSPosix.c +++ b/mDNSPosix/mDNSPosix.c @@ -918,6 +918,7 @@ mDNSlocal int SetupOneInterface(mDNS *const m, struct sockaddr *intfAddr, struct // Set up the extra fields in PosixNetworkInterface. assert(intf->intfName != NULL); // intf->intfName already set up above intf->index = intfIndex; + intf->sa_family = intfAddr->sa_family; intf->multicastSocket4 = -1; #if HAVE_IPV6 intf->multicastSocket6 = -1; diff --git a/mDNSPosix/mDNSPosix.h b/mDNSPosix/mDNSPosix.h index ca60d80..f77c185 100644 --- a/mDNSPosix/mDNSPosix.h +++ b/mDNSPosix/mDNSPosix.h @@ -19,6 +19,7 @@ #define __mDNSPlatformPosix_h #include +#include #include #ifdef __cplusplus @@ -40,6 +41,7 @@ struct PosixNetworkInterface const char * intfName; PosixNetworkInterface * aliasIntf; int index; + sa_family_t sa_family; int multicastSocket4; #if HAVE_IPV6 int multicastSocket6; -- 2.17.1