Module Name: src
Committed By: roy
Date: Sat Jan 18 16:51:44 UTC 2014
Modified Files:
src/external/apache2/mDNSResponder/dist/mDNSPosix: mDNSUNP.c
Log Message:
Don't try and use an address we can't use.
To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 \
src/external/apache2/mDNSResponder/dist/mDNSPosix/mDNSUNP.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/external/apache2/mDNSResponder/dist/mDNSPosix/mDNSUNP.c
diff -u src/external/apache2/mDNSResponder/dist/mDNSPosix/mDNSUNP.c:1.2 src/external/apache2/mDNSResponder/dist/mDNSPosix/mDNSUNP.c:1.3
--- src/external/apache2/mDNSResponder/dist/mDNSPosix/mDNSUNP.c:1.2 Tue Sep 29 23:56:28 2009
+++ src/external/apache2/mDNSResponder/dist/mDNSPosix/mDNSUNP.c Sat Jan 18 16:51:44 2014
@@ -411,6 +411,24 @@ struct ifi_info *get_ifi_info(int family
if ((flags & IFF_UP) == 0)
continue; /* ignore if interface not up */
+ /* Skip addresses we can't use */
+#ifdef SIOCGIFAFLAG_IN6
+ if (ifr->ifr_addr.sa_family == AF_INET6) {
+ struct in6_ifreq ifr6;
+
+ if (sockf6 == -1)
+ sockf6 = socket(AF_INET6, SOCK_DGRAM, 0);
+ memset(&ifr6, 0, sizeof(ifr6));
+ memcpy(&ifr6.ifr_name, &ifr->ifr_name, sizeof(ifr6.ifr_name));
+ memcpy(&ifr6.ifr_addr, &ifr->ifr_addr, sizeof(ifr6.ifr_addr));
+ if (ioctl(sockf6, SIOCGIFAFLAG_IN6, &ifr6) < 0)
+ goto gotError;
+ if (ifr6.ifr_ifru.ifru_flags6 &
+ (IN6_IFF_NOTREADY | IN6_IFF_DETACHED))
+ continue;
+ }
+#endif
+
ifi = (struct ifi_info*)calloc(1, sizeof(struct ifi_info));
if (ifi == NULL) {
goto gotError;