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 put back handl...
details: https://anonhg.NetBSD.org/src/rev/522cdb12e1f2
branches: trunk
changeset: 321837:522cdb12e1f2
user: christos <christos%NetBSD.org@localhost>
date: Sat Apr 07 19:18:16 2018 +0000
description:
put back handling for SIOCGIFAFLAG_IN -- should not matter.
diffstat:
external/apache2/mDNSResponder/dist/mDNSPosix/mDNSUNP.c | 30 +++++++++++++++++
1 files changed, 30 insertions(+), 0 deletions(-)
diffs (40 lines):
diff -r 64b38261142d -r 522cdb12e1f2 external/apache2/mDNSResponder/dist/mDNSPosix/mDNSUNP.c
--- a/external/apache2/mDNSResponder/dist/mDNSPosix/mDNSUNP.c Sat Apr 07 19:13:27 2018 +0000
+++ b/external/apache2/mDNSResponder/dist/mDNSPosix/mDNSUNP.c Sat Apr 07 19:18:16 2018 +0000
@@ -303,6 +303,36 @@
if ((flags & IFF_UP) == 0)
continue; /* ignore if interface not up */
+ if ((flags & IFF_LOOPBACK))
+ continue; /* ignore loopback interfaces */
+
+ /* Skip addresses we can't use */
+#ifdef SIOCGIFAFLAG_IN
+ if (ifr->ifr_addr.sa_family == AF_INET) {
+ ifrcopy = *ifr;
+ if (ioctl(sockfd, SIOCGIFAFLAG_IN, &ifrcopy) < 0)
+ goto gotError;
+ if (ifrcopy.ifr_addrflags & (IN_IFF_NOTREADY | IN_IFF_DETACHED))
+ continue;
+ }
+#endif
+#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