diff options
author | ume <ume@FreeBSD.org> | 2005-05-13 16:31:11 +0000 |
---|---|---|
committer | ume <ume@FreeBSD.org> | 2005-05-13 16:31:11 +0000 |
commit | e33ba033454acbec171e04edba1395842e412b5c (patch) | |
tree | 9ae1266a1a3de18e5409202ab088ec8928d3410e /lib | |
parent | 4c5083a81ce14f96f4193b746c54f7e17d94e21b (diff) | |
download | FreeBSD-src-e33ba033454acbec171e04edba1395842e412b5c.zip FreeBSD-src-e33ba033454acbec171e04edba1395842e412b5c.tar.gz |
NI_WITHSCOPEID cleanup. Neither RFC 2553 nor RFC 3493 defines
NI_WITHSCOPEID, and our getaddrinfo(3) does nothing special
for it, now.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libc/net/rcmd.c | 24 | ||||
-rw-r--r-- | lib/libc/net/res_send.c | 5 | ||||
-rw-r--r-- | lib/libutil/logwtmp.c | 7 | ||||
-rw-r--r-- | lib/libutil/realhostname.c | 9 |
4 files changed, 11 insertions, 34 deletions
diff --git a/lib/libc/net/rcmd.c b/lib/libc/net/rcmd.c index 3ded900..422e903 100644 --- a/lib/libc/net/rcmd.c +++ b/lib/libc/net/rcmd.c @@ -63,11 +63,6 @@ __FBSDID("$FreeBSD$"); #include <arpa/nameser.h> #include "un-namespace.h" -/* wrapper for KAME-special getnameinfo() */ -#ifndef NI_WITHSCOPEID -#define NI_WITHSCOPEID 0 -#endif - extern int innetgr( const char *, const char *, const char *, const char * ); #define max(a, b) ((a > b) ? a : b) @@ -197,10 +192,8 @@ rcmd_af(ahost, rport, locuser, remuser, cmd, fd2p, af) if (nres > 1) { int oerrno = errno; - getnameinfo(ai->ai_addr, ai->ai_addrlen, - paddr, sizeof(paddr), - NULL, 0, - NI_NUMERICHOST|NI_WITHSCOPEID); + getnameinfo(ai->ai_addr, ai->ai_addrlen, paddr, + sizeof(paddr), NULL, 0, NI_NUMERICHOST); (void)fprintf(stderr, "connect to address %s: ", paddr); errno = oerrno; @@ -218,10 +211,8 @@ rcmd_af(ahost, rport, locuser, remuser, cmd, fd2p, af) refused = 0; } if (nres > 1) { - getnameinfo(ai->ai_addr, ai->ai_addrlen, - paddr, sizeof(paddr), - NULL, 0, - NI_NUMERICHOST|NI_WITHSCOPEID); + getnameinfo(ai->ai_addr, ai->ai_addrlen, paddr, + sizeof(paddr), NULL, 0, NI_NUMERICHOST); fprintf(stderr, "Trying %s...\n", paddr); } } @@ -717,9 +708,6 @@ __ivaliduser_sa(hostf, raddr, salen, luser, ruser) /* * Returns "true" if match, 0 if no match. - * - * NI_WITHSCOPEID is useful for comparing sin6_scope_id portion - * if af == AF_INET6. */ static int __icheckhost(raddr, salen, lhost) @@ -748,7 +736,7 @@ __icheckhost(raddr, salen, lhost) h1[0] = '\0'; if (getnameinfo(raddr, salen, h1, sizeof(h1), NULL, 0, - NI_NUMERICHOST | NI_WITHSCOPEID) != 0) + NI_NUMERICHOST) != 0) return (0); /* Resolve laddr into sockaddr */ @@ -763,7 +751,7 @@ __icheckhost(raddr, salen, lhost) for (r = res; r ; r = r->ai_next) { h2[0] = '\0'; if (getnameinfo(r->ai_addr, r->ai_addrlen, h2, sizeof(h2), - NULL, 0, NI_NUMERICHOST | NI_WITHSCOPEID) != 0) + NULL, 0, NI_NUMERICHOST) != 0) continue; if (strcmp(h1, h2) == 0) { freeaddrinfo(res); diff --git a/lib/libc/net/res_send.c b/lib/libc/net/res_send.c index 014de81..1775ead 100644 --- a/lib/libc/net/res_send.c +++ b/lib/libc/net/res_send.c @@ -141,8 +141,7 @@ static void Perror(FILE *, char *, int); char pbuf[NI_MAXSERV]; if (getnameinfo(address, address->sa_len, abuf, sizeof(abuf), - pbuf, sizeof(pbuf), - NI_NUMERICHOST|NI_NUMERICSERV|NI_WITHSCOPEID) != 0) { + pbuf, sizeof(pbuf), NI_NUMERICHOST|NI_NUMERICSERV) != 0) { strncpy(abuf, "?", sizeof(abuf)); strncpy(pbuf, "?", sizeof(pbuf)); } @@ -444,7 +443,7 @@ res_send(buf, buflen, ans, anssiz) Dprint((_res.options & RES_DEBUG) && getnameinfo(nsap, salen, abuf, sizeof(abuf), - NULL, 0, NI_NUMERICHOST | NI_WITHSCOPEID) == 0, + NULL, 0, NI_NUMERICHOST) == 0, (stdout, ";; Querying server (# %d) address = %s\n", ns + 1, abuf)); diff --git a/lib/libutil/logwtmp.c b/lib/libutil/logwtmp.c index 03ee4cf..42f3599 100644 --- a/lib/libutil/logwtmp.c +++ b/lib/libutil/logwtmp.c @@ -54,11 +54,6 @@ static char sccsid[] = "@(#)logwtmp.c 8.1 (Berkeley) 6/4/93"; #include <unistd.h> #include <utmp.h> -/* wrapper for KAME-special getnameinfo() */ -#ifndef NI_WITHSCOPEID -#define NI_WITHSCOPEID 0 -#endif - void logwtmp(const char *line, const char *name, const char *host) @@ -86,7 +81,7 @@ logwtmp(const char *line, const char *name, const char *host) else { error = getnameinfo(res->ai_addr, res->ai_addrlen, fullhost, strlen(fullhost), NULL, 0, - NI_NUMERICHOST|NI_WITHSCOPEID); + NI_NUMERICHOST); if (error != 0) { fprintf(stderr, "%d", error); host = "invalid hostname"; diff --git a/lib/libutil/realhostname.c b/lib/libutil/realhostname.c index 6eff893..6a1b82f 100644 --- a/lib/libutil/realhostname.c +++ b/lib/libutil/realhostname.c @@ -39,11 +39,6 @@ __FBSDID("$FreeBSD$"); #include "libutil.h" -/* wrapper for KAME-special getnameinfo() */ -#ifndef NI_WITHSCOPEID -#define NI_WITHSCOPEID 0 -#endif - struct sockinet { u_char si_len; u_char si_family; @@ -119,7 +114,7 @@ realhostname_sa(char *host, size_t hsize, struct sockaddr *addr, int addrlen) #endif error = getnameinfo(addr, addrlen, buf, sizeof(buf), NULL, 0, - NI_WITHSCOPEID | NI_NAMEREQD); + NI_NAMEREQD); if (error == 0) { struct addrinfo hints, *res, *ores; struct sockaddr *sa; @@ -181,7 +176,7 @@ realhostname_sa(char *host, size_t hsize, struct sockaddr *addr, int addrlen) } else { numeric: if (getnameinfo(addr, addrlen, buf, sizeof(buf), NULL, 0, - NI_NUMERICHOST|NI_WITHSCOPEID) == 0) + NI_NUMERICHOST) == 0) strncpy(host, buf, hsize); } |