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
This commit is contained in:
Yoshinobu Inoue 2000-02-19 16:10:16 +00:00
parent 6d939e82e0
commit 0ca229d64d
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=57340
5 changed files with 9 additions and 12 deletions

View File

@ -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

View File

@ -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 */

View File

@ -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}?)?

View File

@ -108,7 +108,7 @@ hexstring 0[xX]{hexdigit}+
octetstring {octet}({dot}{octet})+
ipaddress {ipv4addr}|{ipv6addr}
ipv4addr {digit}{1,3}({dot}{digit}{1,3}){0,3}
ipv6addr {hexdigit}{0,4}({colon}{hexdigit}{0,4}){2,7}(@{letter}{letter}+)?
ipv6addr {hexdigit}{0,4}({colon}{hexdigit}{0,4}){2,7}(%{letter}{letter}+)?
ipaddrmask {slash}{digit}{1,3}
ipaddrport {blcl}{decstring}{elcl}
keyword {letter}{letter}+

View File

@ -108,7 +108,7 @@ hexstring 0[xX]{hexdigit}+
octetstring {octet}({dot}{octet})+
ipaddress {ipv4addr}|{ipv6addr}
ipv4addr {digit}{1,3}({dot}{digit}{1,3}){0,3}
ipv6addr {hexdigit}{0,4}({colon}{hexdigit}{0,4}){2,7}(@{letter}{letter}+)?
ipv6addr {hexdigit}{0,4}({colon}{hexdigit}{0,4}){2,7}(%{letter}{letter}+)?
ipaddrmask {slash}{digit}{1,3}
ipaddrport {blcl}{decstring}{elcl}
keyword {letter}{letter}+