netresolv: Mark code changes with __HAIKU__.

I attempted to merge NetBSD's new irs code, but their changes turned
out to be too invasive to do trivially, but in the process I had to
read our commit logs to find what we've changed, so at least I can
mark that.
This commit is contained in:
Augustin Cavalier 2018-08-01 17:28:35 -04:00
parent 4cc9ce9ddd
commit c9431a6752
1 changed files with 11 additions and 2 deletions

View File

@ -598,6 +598,10 @@ getaddrinfo(const char *hostname, const char *servname,
error = explore_fqdn(pai, hostname, servname, &cur->ai_next,
&svd);
#ifndef __HAIKU__
while (cur && cur->ai_next)
cur = cur->ai_next;
#else
while (cur && cur->ai_next) {
if ((((uint64_t)1 << cur->ai_next->ai_family) & mask) == 0) {
/* entry does not match addrconfig mask, remove from list */
@ -611,6 +615,7 @@ getaddrinfo(const char *hostname, const char *servname,
}
}
}
#endif
/* XXX */
if (sentinel.ai_next)
@ -1103,9 +1108,13 @@ addrconfig(uint64_t *mask)
*mask = 0;
for (ifa = ifaddrs; ifa != NULL; ifa = ifa->ifa_next)
if (ifa->ifa_addr && (ifa->ifa_flags & IFF_UP)
&& !(ifa->ifa_flags & IFF_LOOPBACK)) {
#ifndef __HAIKU__
if (ifa->ifa_addr && (ifa->ifa_flags & IFF_UP)) {
#else
if (ifa->ifa_addr && (ifa->ifa_flags & IFF_UP)
&& !(ifa->ifa_flags & IFF_LOOPBACK)) {
assert(ifa->ifa_addr->sa_family < 64);
#endif
*mask |= (uint64_t)1 << ifa->ifa_addr->sa_family;
}