diff options
author | ume <ume@FreeBSD.org> | 2003-10-21 20:11:47 +0000 |
---|---|---|
committer | ume <ume@FreeBSD.org> | 2003-10-21 20:11:47 +0000 |
commit | bf741bc603a4e3d435392d831a2e8a401ed1d49e (patch) | |
tree | 88df25c0dd2a0863fe049f3df815c6e7ba0ce36d | |
parent | 5199c863f8f9e7f134710595dee582ad037bffb6 (diff) | |
download | FreeBSD-src-bf741bc603a4e3d435392d831a2e8a401ed1d49e.zip FreeBSD-src-bf741bc603a4e3d435392d831a2e8a401ed1d49e.tar.gz |
stop use of NI_WITHSCOPEID. it was deprecated.
Obtained from: KAME
-rw-r--r-- | include/netdb.h | 2 | ||||
-rw-r--r-- | lib/libc/net/getnameinfo.3 | 11 | ||||
-rw-r--r-- | lib/libipsec/ipsec_dump_policy.c | 4 | ||||
-rw-r--r-- | lib/libipsec/pfkey_dump.c | 4 | ||||
-rw-r--r-- | sbin/ping6/ping6.c | 7 | ||||
-rw-r--r-- | usr.sbin/faithd/prefix.c | 4 | ||||
-rw-r--r-- | usr.sbin/ifmcstat/ifmcstat.c | 4 | ||||
-rw-r--r-- | usr.sbin/traceroute6/traceroute6.c | 23 |
8 files changed, 13 insertions, 46 deletions
diff --git a/include/netdb.h b/include/netdb.h index 4fb0aa8..cf55739 100644 --- a/include/netdb.h +++ b/include/netdb.h @@ -195,7 +195,9 @@ struct addrinfo { #define NI_NAMEREQD 0x00000004 #define NI_NUMERICSERV 0x00000008 #define NI_DGRAM 0x00000010 +#if 1 /* obsolete */ #define NI_WITHSCOPEID 0x00000020 +#endif /* * Scope delimit character diff --git a/lib/libc/net/getnameinfo.3 b/lib/libc/net/getnameinfo.3 index bf197dc..88c3914 100644 --- a/lib/libc/net/getnameinfo.3 +++ b/lib/libc/net/getnameinfo.3 @@ -178,16 +178,11 @@ These flags are defined in .In netdb.h . .\" -.Sh EXTENSION +.Ss Extension for scoped IPv6 address The implementation allows experimental numeric IPv6 address notation with scope identifier. -IPv6 link-local address will appear as string like -.Dq Li fe80::1%ne0 , -if -.Dv NI_WITHSCOPEID -bit is enabled in -.Fa flags -argument. +IPv6 link-local address will appear as a string like +.Dq Li fe80::1%ne0 . Refer to .Xr getaddrinfo 3 for the notation. diff --git a/lib/libipsec/ipsec_dump_policy.c b/lib/libipsec/ipsec_dump_policy.c index 721ff20..98d16aa 100644 --- a/lib/libipsec/ipsec_dump_policy.c +++ b/lib/libipsec/ipsec_dump_policy.c @@ -293,11 +293,7 @@ set_address(buf, len, sa) size_t len; struct sockaddr *sa; { -#ifdef NI_WITHSCOPEID - const int niflags = NI_NUMERICHOST | NI_WITHSCOPEID; -#else const int niflags = NI_NUMERICHOST; -#endif if (len < 1) return NULL; diff --git a/lib/libipsec/pfkey_dump.c b/lib/libipsec/pfkey_dump.c index 0113e14..4d8eb4a 100644 --- a/lib/libipsec/pfkey_dump.c +++ b/lib/libipsec/pfkey_dump.c @@ -497,11 +497,7 @@ str_ipaddr(sa) struct sockaddr *sa; { static char buf[NI_MAXHOST]; -#ifdef NI_WITHSCOPEID - const int niflag = NI_NUMERICHOST | NI_WITHSCOPEID; -#else const int niflag = NI_NUMERICHOST; -#endif if (sa == NULL) return ""; diff --git a/sbin/ping6/ping6.c b/sbin/ping6/ping6.c index c8f3ba8..70e2221 100644 --- a/sbin/ping6/ping6.c +++ b/sbin/ping6/ping6.c @@ -2477,13 +2477,8 @@ pr_addr(addr, addrlen) int addrlen; { static char buf[NI_MAXHOST]; - int flag; + int flag = 0; -#ifdef NI_WITHSCOPEID - flag = NI_WITHSCOPEID; -#else - flag = 0; -#endif if ((options & F_HOSTNAME) == 0) flag |= NI_NUMERICHOST; diff --git a/usr.sbin/faithd/prefix.c b/usr.sbin/faithd/prefix.c index a13c640..45140ca 100644 --- a/usr.sbin/faithd/prefix.c +++ b/usr.sbin/faithd/prefix.c @@ -55,11 +55,7 @@ static void config_show __P((void)); #endif struct config *config_list = NULL; -#ifdef NI_WITHSCOPEID -const int niflags = NI_NUMERICHOST | NI_WITHSCOPEID; -#else const int niflags = NI_NUMERICHOST; -#endif static int prefix_set(s, prefix, slash) diff --git a/usr.sbin/ifmcstat/ifmcstat.c b/usr.sbin/ifmcstat/ifmcstat.c index 4097c59..72806ac 100644 --- a/usr.sbin/ifmcstat/ifmcstat.c +++ b/usr.sbin/ifmcstat/ifmcstat.c @@ -87,11 +87,7 @@ const char *inet6_n2a(p) static char buf[NI_MAXHOST]; struct sockaddr_in6 sin6; u_int32_t scopeid; -#ifdef NI_WITHSCOPEID - const int niflags = NI_NUMERICHOST | NI_WITHSCOPEID; -#else const int niflags = NI_NUMERICHOST; -#endif memset(&sin6, 0, sizeof(sin6)); sin6.sin6_family = AF_INET6; diff --git a/usr.sbin/traceroute6/traceroute6.c b/usr.sbin/traceroute6/traceroute6.c index 8b93a84..deab0ef 100644 --- a/usr.sbin/traceroute6/traceroute6.c +++ b/usr.sbin/traceroute6/traceroute6.c @@ -368,12 +368,6 @@ int waittime = 5; /* time to wait for response (in seconds) */ int nflag; /* print addresses numerically */ int lflag; /* print both numerical address & hostname */ -#ifdef KAME_SCOPEID -const int niflag = NI_WITHSCOPEID; -#else -const int niflag = 0; -#endif - int main(argc, argv) int argc; @@ -793,8 +787,7 @@ main(argc, argv) exit(1); } if (getnameinfo((struct sockaddr *)&Src, Src.sin6_len, - src0, sizeof(src0), NULL, 0, - NI_NUMERICHOST | niflag)) { + src0, sizeof(src0), NULL, 0, NI_NUMERICHOST)) { Fprintf(stderr, "getnameinfo failed for source\n"); exit(1); } @@ -828,7 +821,7 @@ main(argc, argv) * Message to users */ if (getnameinfo((struct sockaddr *)&Dst, Dst.sin6_len, hbuf, - sizeof(hbuf), NULL, 0, NI_NUMERICHOST | niflag)) + sizeof(hbuf), NULL, 0, NI_NUMERICHOST)) strlcpy(hbuf, "(invalid)", sizeof(hbuf)); Fprintf(stderr, "traceroute6"); Fprintf(stderr, " to %s (%s)", hostname, hbuf); @@ -1114,8 +1107,7 @@ packet_ok(mhdr, cc, seq) if (cc < hlen + sizeof(struct icmp6_hdr)) { if (verbose) { if (getnameinfo((struct sockaddr *)from, from->sin6_len, - hbuf, sizeof(hbuf), NULL, 0, - NI_NUMERICHOST | niflag) != 0) + hbuf, sizeof(hbuf), NULL, 0, NI_NUMERICHOST) != 0) strlcpy(hbuf, "invalid", sizeof(hbuf)); Printf("packet too short (%d bytes) from %s\n", cc, hbuf); @@ -1128,8 +1120,7 @@ packet_ok(mhdr, cc, seq) if (cc < sizeof(struct icmp6_hdr)) { if (verbose) { if (getnameinfo((struct sockaddr *)from, from->sin6_len, - hbuf, sizeof(hbuf), NULL, 0, - NI_NUMERICHOST | niflag) != 0) + hbuf, sizeof(hbuf), NULL, 0, NI_NUMERICHOST) != 0) strlcpy(hbuf, "invalid", sizeof(hbuf)); Printf("data too short (%d bytes) from %s\n", cc, hbuf); } @@ -1187,7 +1178,7 @@ packet_ok(mhdr, cc, seq) char sbuf[NI_MAXHOST+1], dbuf[INET6_ADDRSTRLEN]; if (getnameinfo((struct sockaddr *)from, from->sin6_len, - sbuf, sizeof(sbuf), NULL, 0, NI_NUMERICHOST | niflag) != 0) + sbuf, sizeof(sbuf), NULL, 0, NI_NUMERICHOST) != 0) strlcpy(sbuf, "invalid", sizeof(hbuf)); Printf("\n%d bytes from %s to %s", cc, sbuf, rcvpktinfo ? inet_ntop(AF_INET6, &rcvpktinfo->ipi6_addr, @@ -1266,7 +1257,7 @@ print(mhdr, cc) char hbuf[NI_MAXHOST]; if (getnameinfo((struct sockaddr *)from, from->sin6_len, - hbuf, sizeof(hbuf), NULL, 0, NI_NUMERICHOST | niflag) != 0) + hbuf, sizeof(hbuf), NULL, 0, NI_NUMERICHOST) != 0) strlcpy(hbuf, "invalid", sizeof(hbuf)); if (nflag) Printf(" %s", hbuf); @@ -1342,7 +1333,7 @@ inetname(sa) return cp; if (getnameinfo(sa, sa->sa_len, line, sizeof(line), NULL, 0, - NI_NUMERICHOST | niflag) != 0) + NI_NUMERICHOST) != 0) strlcpy(line, "invalid", sizeof(line)); return line; } |