diff options
author | shin <shin@FreeBSD.org> | 2000-02-19 16:10:16 +0000 |
---|---|---|
committer | shin <shin@FreeBSD.org> | 2000-02-19 16:10:16 +0000 |
commit | 98f78aba9d0830c72c8bc3a41299b63ac701f87d (patch) | |
tree | c2c50f9850955d5a43d78290f1052fd302da52ea /lib | |
parent | 64995770850f2ea869f74413a0bebc17df9a6db4 (diff) | |
download | FreeBSD-src-98f78aba9d0830c72c8bc3a41299b63ac701f87d.zip FreeBSD-src-98f78aba9d0830c72c8bc3a41299b63ac701f87d.tar.gz |
Change IPv6 scoped addr format again based on recent standard discussion.
Sorry for the flapping, but no change will be done for 4.0 anymore.
Official standard will be published around April or later.
If different format would be adopted at that time, then support for
the new format will be added to the succeeding FreeBSD 4.x.
Approved by: jkh
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libc/net/getaddrinfo.c | 4 | ||||
-rw-r--r-- | lib/libc/net/getnameinfo.c | 11 | ||||
-rw-r--r-- | lib/libipsec/policy_token.l | 2 |
3 files changed, 7 insertions, 10 deletions
diff --git a/lib/libc/net/getaddrinfo.c b/lib/libc/net/getaddrinfo.c index 8b6d6b7..a1f2726 100644 --- a/lib/libc/net/getaddrinfo.c +++ b/lib/libc/net/getaddrinfo.c @@ -709,7 +709,7 @@ explore_numeric_scope(pai, hostname, servname, res) switch (pai->ai_family) { #ifdef INET6 case AF_INET6: - scope = if_nametoindex(hostname2); + scope = if_nametoindex(cp); if (scope == 0) { error = EAI_SYSTEM; goto free; @@ -718,7 +718,7 @@ explore_numeric_scope(pai, hostname, servname, res) #endif } - error = explore_numeric(pai, cp, servname, res); + error = explore_numeric(pai, hostname2, servname, res); if (error == 0) { for (cur = *res; cur; cur = cur->ai_next) { #ifdef INET6 diff --git a/lib/libc/net/getnameinfo.c b/lib/libc/net/getnameinfo.c index 42f7906..5edcffb 100644 --- a/lib/libc/net/getnameinfo.c +++ b/lib/libc/net/getnameinfo.c @@ -199,14 +199,11 @@ getnameinfo(sa, salen, host, hostlen, serv, servlen, flags) + scopelen > hostlen) return ENI_MEMORY; /* - * Shift the host string to allocate - * space for the scope ID part. + * Construct <numeric-addr><delim><scopeid> */ - memmove(host + scopelen + 1, host, numaddrlen); - /* copy the scope ID and the delimiter */ - memcpy(host, ifname, scopelen); - host[scopelen] = SCOPE_DELIMITER; - host[scopelen + 1 + numaddrlen] = '\0'; + memcpy(host + numaddrlen + 1, ifname, scopelen); + host[numaddrlen] = SCOPE_DELIMITER; + host[numaddrlen + 1 + scopelen] = '\0'; } } #endif /* INET6 */ diff --git a/lib/libipsec/policy_token.l b/lib/libipsec/policy_token.l index 1e7b714..c9737cb 100644 --- a/lib/libipsec/policy_token.l +++ b/lib/libipsec/policy_token.l @@ -79,7 +79,7 @@ decstring {digit}+ hexpair {hexdigit}{hexdigit} hexstring 0[xX]{hexdigit}+ octetstring {octet}({dot}{octet})+ -ipaddress [a-zA-Z0-9:\._][a-zA-Z0-9:\._]*(@{letter}{letter}+)? +ipaddress [a-zA-Z0-9:\._][a-zA-Z0-9:\._]*(%{letter}{letter}+)? name {letter}(({letter}|{digit}|{hyphen})*({letter}|{digit}))* hostname {name}(({dot}{name})+{dot}?)? |