summaryrefslogtreecommitdiff
path: root/src/lib/libc/net/rcmd.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libc/net/rcmd.c')
-rw-r--r--src/lib/libc/net/rcmd.c20
1 files changed, 1 insertions, 19 deletions
diff --git a/src/lib/libc/net/rcmd.c b/src/lib/libc/net/rcmd.c
index 769e85e0a4..b99a35b38c 100644
--- a/src/lib/libc/net/rcmd.c
+++ b/src/lib/libc/net/rcmd.c
@@ -29,7 +29,7 @@
29 */ 29 */
30 30
31#if defined(LIBC_SCCS) && !defined(lint) 31#if defined(LIBC_SCCS) && !defined(lint)
32static char *rcsid = "$OpenBSD: rcmd.c,v 1.48 2003/09/25 21:14:46 millert Exp $"; 32static char *rcsid = "$OpenBSD: rcmd.c,v 1.49 2004/11/17 01:42:26 itojun Exp $";
33#endif /* LIBC_SCCS and not lint */ 33#endif /* LIBC_SCCS and not lint */
34 34
35#include <sys/param.h> 35#include <sys/param.h>
@@ -161,11 +161,7 @@ rcmd_af(ahost, rport, locuser, remuser, cmd, fd2p, af)
161 if (r->ai_next) { 161 if (r->ai_next) {
162 int oerrno = errno; 162 int oerrno = errno;
163 char hbuf[NI_MAXHOST]; 163 char hbuf[NI_MAXHOST];
164#ifdef NI_WITHSCOPEID
165 const int niflags = NI_NUMERICHOST | NI_WITHSCOPEID;
166#else
167 const int niflags = NI_NUMERICHOST; 164 const int niflags = NI_NUMERICHOST;
168#endif
169 165
170 hbuf[0] = '\0'; 166 hbuf[0] = '\0';
171 if (getnameinfo(r->ai_addr, r->ai_addrlen, 167 if (getnameinfo(r->ai_addr, r->ai_addrlen,
@@ -610,9 +606,6 @@ bail:
610/* 606/*
611 * Returns "true" if match, 0 if no match. If we do not find any 607 * Returns "true" if match, 0 if no match. If we do not find any
612 * semblance of an A->PTR->A loop, allow a simple #.#.#.# match to work. 608 * semblance of an A->PTR->A loop, allow a simple #.#.#.# match to work.
613 *
614 * NI_WITHSCOPEID is useful for comparing sin6_scope_id portion
615 * if af == AF_INET6.
616 */ 609 */
617static int 610static int
618__icheckhost(raddr, salen, lhost) 611__icheckhost(raddr, salen, lhost)
@@ -623,11 +616,7 @@ __icheckhost(raddr, salen, lhost)
623 struct addrinfo hints, *res, *r; 616 struct addrinfo hints, *res, *r;
624 char h1[NI_MAXHOST], h2[NI_MAXHOST]; 617 char h1[NI_MAXHOST], h2[NI_MAXHOST];
625 int error; 618 int error;
626#ifdef NI_WITHSCOPEID
627 const int niflags = NI_NUMERICHOST | NI_WITHSCOPEID;
628#else
629 const int niflags = NI_NUMERICHOST; 619 const int niflags = NI_NUMERICHOST;
630#endif
631 620
632 h1[0] = '\0'; 621 h1[0] = '\0';
633 if (getnameinfo(raddr, salen, h1, sizeof(h1), NULL, 0, 622 if (getnameinfo(raddr, salen, h1, sizeof(h1), NULL, 0,
@@ -666,9 +655,6 @@ __icheckhost(raddr, salen, lhost)
666 * Return the hostname associated with the supplied address. 655 * Return the hostname associated with the supplied address.
667 * Do a reverse lookup as well for security. If a loop cannot 656 * Do a reverse lookup as well for security. If a loop cannot
668 * be found, pack the result of inet_ntoa() into the string. 657 * be found, pack the result of inet_ntoa() into the string.
669 *
670 * NI_WITHSCOPEID is useful for comparing sin6_scope_id portion
671 * if af == AF_INET6.
672 */ 658 */
673static char * 659static char *
674__gethostloop(raddr, salen) 660__gethostloop(raddr, salen)
@@ -679,11 +665,7 @@ __gethostloop(raddr, salen)
679 char h1[NI_MAXHOST], h2[NI_MAXHOST]; 665 char h1[NI_MAXHOST], h2[NI_MAXHOST];
680 struct addrinfo hints, *res, *r; 666 struct addrinfo hints, *res, *r;
681 int error; 667 int error;
682#ifdef NI_WITHSCOPEID
683 const int niflags = NI_NUMERICHOST | NI_WITHSCOPEID;
684#else
685 const int niflags = NI_NUMERICHOST; 668 const int niflags = NI_NUMERICHOST;
686#endif
687 669
688 h1[0] = remotehost[0] = '\0'; 670 h1[0] = remotehost[0] = '\0';
689 if (getnameinfo(raddr, salen, remotehost, sizeof(remotehost), 671 if (getnameinfo(raddr, salen, remotehost, sizeof(remotehost),