diff options
Diffstat (limited to 'lib/libc/net/name6.c')
-rw-r--r-- | lib/libc/net/name6.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/lib/libc/net/name6.c b/lib/libc/net/name6.c index 36df9a0..4ab24b3 100644 --- a/lib/libc/net/name6.c +++ b/lib/libc/net/name6.c @@ -94,6 +94,7 @@ * rewrite resolvers to be thread safe */ +#include "namespace.h" #include <sys/param.h> #include <sys/socket.h> #include <sys/time.h> @@ -112,6 +113,7 @@ #include <stdarg.h> #include <nsswitch.h> #include <unistd.h> +#include "un-namespace.h" #ifndef _PATH_HOSTS #define _PATH_HOSTS "/etc/hosts" @@ -255,11 +257,11 @@ _ghbyname(const char *name, int af, int flags, int *errp) * because addresses will be dynamically assigned or deleted. */ if (af == AF_UNSPEC) { - if ((s = socket(AF_INET6, SOCK_DGRAM, 0)) < 0) + if ((s = _socket(AF_INET6, SOCK_DGRAM, 0)) < 0) af = AF_INET; else { _close(s); - if ((s = socket(AF_INET, SOCK_DGRAM, 0)) < 0) + if ((s = _socket(AF_INET, SOCK_DGRAM, 0)) < 0) af = AF_INET6; else _close(s); @@ -267,7 +269,7 @@ _ghbyname(const char *name, int af, int flags, int *errp) } if (af != AF_UNSPEC) { - if ((s = socket(af, SOCK_DGRAM, 0)) < 0) + if ((s = _socket(af, SOCK_DGRAM, 0)) < 0) return NULL; _close(s); } @@ -1699,11 +1701,11 @@ _icmp_fqdn_query(const struct in6_addr *addr, int ifindex) msg.msg_controllen = (char *)cmsg - cbuf; } - if ((s = socket(PF_INET6, SOCK_RAW, IPPROTO_ICMPV6)) < 0) + if ((s = _socket(PF_INET6, SOCK_RAW, IPPROTO_ICMPV6)) < 0) return NULL; - (void)setsockopt(s, IPPROTO_ICMPV6, ICMP6_FILTER, + (void)_setsockopt(s, IPPROTO_ICMPV6, ICMP6_FILTER, (char *)&filter, sizeof(filter)); - cc = sendmsg(s, &msg, 0); + cc = _sendmsg(s, &msg, 0); if (cc < 0) { _close(s); return NULL; @@ -1711,12 +1713,12 @@ _icmp_fqdn_query(const struct in6_addr *addr, int ifindex) FD_SET(s, &s_fds); for (;;) { fds = s_fds; - if (select(s + 1, &fds, NULL, NULL, &tout) <= 0) { + if (_select(s + 1, &fds, NULL, NULL, &tout) <= 0) { _close(s); return NULL; } len = sizeof(sin6); - cc = recvfrom(s, buf, sizeof(buf), 0, + cc = _recvfrom(s, buf, sizeof(buf), 0, (struct sockaddr *)&sin6, &len); if (cc <= 0) { _close(s); |