diff options
author | itojun <> | 2004-11-17 01:42:26 +0000 |
---|---|---|
committer | itojun <> | 2004-11-17 01:42:26 +0000 |
commit | 51276de4f2e443054734a1236d213f9f7d1e9639 (patch) | |
tree | 2020e780983b08eb08ce16ba549c146d1a1ad009 | |
parent | bce583064b7937a968bb5c43269e19ee6fc9fc2d (diff) | |
download | openbsd-51276de4f2e443054734a1236d213f9f7d1e9639.tar.gz openbsd-51276de4f2e443054734a1236d213f9f7d1e9639.tar.bz2 openbsd-51276de4f2e443054734a1236d213f9f7d1e9639.zip |
remove NI_WITHSCOPEID (which is not standard)
-rw-r--r-- | src/lib/libc/net/rcmd.c | 20 | ||||
-rw-r--r-- | src/lib/libc/net/res_send.c | 9 |
2 files changed, 5 insertions, 24 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) |
32 | static char *rcsid = "$OpenBSD: rcmd.c,v 1.48 2003/09/25 21:14:46 millert Exp $"; | 32 | static 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 | */ |
617 | static int | 610 | static 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 | */ |
673 | static char * | 659 | static 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), |
diff --git a/src/lib/libc/net/res_send.c b/src/lib/libc/net/res_send.c index c456a92d32..51fa777142 100644 --- a/src/lib/libc/net/res_send.c +++ b/src/lib/libc/net/res_send.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: res_send.c,v 1.15 2003/06/02 20:18:36 millert Exp $ */ | 1 | /* $OpenBSD: res_send.c,v 1.16 2004/11/17 01:42:26 itojun Exp $ */ |
2 | 2 | ||
3 | /* | 3 | /* |
4 | * ++Copyright++ 1985, 1989, 1993 | 4 | * ++Copyright++ 1985, 1989, 1993 |
@@ -60,7 +60,7 @@ | |||
60 | static char sccsid[] = "@(#)res_send.c 8.1 (Berkeley) 6/4/93"; | 60 | static char sccsid[] = "@(#)res_send.c 8.1 (Berkeley) 6/4/93"; |
61 | static char rcsid[] = "$From: res_send.c,v 8.12 1996/10/08 04:51:06 vixie Exp $"; | 61 | static char rcsid[] = "$From: res_send.c,v 8.12 1996/10/08 04:51:06 vixie Exp $"; |
62 | #else | 62 | #else |
63 | static char rcsid[] = "$OpenBSD: res_send.c,v 1.15 2003/06/02 20:18:36 millert Exp $"; | 63 | static char rcsid[] = "$OpenBSD: res_send.c,v 1.16 2004/11/17 01:42:26 itojun Exp $"; |
64 | #endif | 64 | #endif |
65 | #endif /* LIBC_SCCS and not lint */ | 65 | #endif /* LIBC_SCCS and not lint */ |
66 | 66 | ||
@@ -139,8 +139,7 @@ static void Perror(FILE *, char *, int); | |||
139 | 139 | ||
140 | if (_resp->options & RES_DEBUG) { | 140 | if (_resp->options & RES_DEBUG) { |
141 | if (getnameinfo(address, address->sa_len, abuf, sizeof(abuf), | 141 | if (getnameinfo(address, address->sa_len, abuf, sizeof(abuf), |
142 | pbuf, sizeof(pbuf), | 142 | pbuf, sizeof(pbuf), NI_NUMERICHOST | NI_NUMERICSERV) != 0) { |
143 | NI_NUMERICHOST|NI_NUMERICSERV|NI_WITHSCOPEID) != 0) { | ||
144 | strlcpy(abuf, "?", sizeof(abuf)); | 143 | strlcpy(abuf, "?", sizeof(abuf)); |
145 | strlcpy(pbuf, "?", sizeof(pbuf)); | 144 | strlcpy(pbuf, "?", sizeof(pbuf)); |
146 | } | 145 | } |
@@ -432,7 +431,7 @@ res_send(buf, buflen, ans, anssiz) | |||
432 | 431 | ||
433 | Dprint((_resp->options & RES_DEBUG) && | 432 | Dprint((_resp->options & RES_DEBUG) && |
434 | getnameinfo(nsap, salen, abuf, sizeof(abuf), | 433 | getnameinfo(nsap, salen, abuf, sizeof(abuf), |
435 | NULL, 0, NI_NUMERICHOST | NI_WITHSCOPEID) == 0, | 434 | NULL, 0, NI_NUMERICHOST) == 0, |
436 | (stdout, ";; Querying server (# %d) address = %s\n", | 435 | (stdout, ";; Querying server (# %d) address = %s\n", |
437 | ns + 1, abuf)); | 436 | ns + 1, abuf)); |
438 | 437 | ||