diff options
| author | christos <christos@NetBSD.org> | 2018-04-07 19:18:16 +0000 |
|---|---|---|
| committer | christos <christos@NetBSD.org> | 2018-04-07 19:18:16 +0000 |
| commit | 444ed33ee0227fc4e4a737b2f9c5ea979d8a06db (patch) | |
| tree | 0863339000b9cc9ca683c32e8a8f24c0706510a4 /external/apache2 | |
| parent | 160108de8095678d8670854b23a0d3d9f4d60e4a (diff) | |
put back handling for SIOCGIFAFLAG_IN -- should not matter.
Diffstat (limited to 'external/apache2')
| -rwxr-xr-x | external/apache2/mDNSResponder/dist/mDNSPosix/mDNSUNP.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/external/apache2/mDNSResponder/dist/mDNSPosix/mDNSUNP.c b/external/apache2/mDNSResponder/dist/mDNSPosix/mDNSUNP.c index e93808eaa4d..1eb0a31de7d 100755 --- a/external/apache2/mDNSResponder/dist/mDNSPosix/mDNSUNP.c +++ b/external/apache2/mDNSResponder/dist/mDNSPosix/mDNSUNP.c @@ -303,6 +303,36 @@ struct ifi_info *get_ifi_info(int family, int doaliases) 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; |
