Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/external/apache2/mDNSResponder/dist/mDNSPosix Don't try and ...
details: https://anonhg.NetBSD.org/src/rev/c8a89f0be1bb
branches: trunk
changeset: 326102:c8a89f0be1bb
user: roy <roy%NetBSD.org@localhost>
date: Sat Jan 18 16:51:44 2014 +0000
description:
Don't try and use an address we can't use.
diffstat:
external/apache2/mDNSResponder/dist/mDNSPosix/mDNSUNP.c | 18 +++++++++++++++++
1 files changed, 18 insertions(+), 0 deletions(-)
diffs (28 lines):
diff -r f305d7f865de -r c8a89f0be1bb external/apache2/mDNSResponder/dist/mDNSPosix/mDNSUNP.c
--- a/external/apache2/mDNSResponder/dist/mDNSPosix/mDNSUNP.c Sat Jan 18 15:55:32 2014 +0000
+++ b/external/apache2/mDNSResponder/dist/mDNSPosix/mDNSUNP.c Sat Jan 18 16:51:44 2014 +0000
@@ -411,6 +411,24 @@
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;
Home |
Main Index |
Thread Index |
Old Index