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:
parent
6d939e82e0
commit
0ca229d64d
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=57340
@ -709,7 +709,7 @@ explore_numeric_scope(pai, hostname, servname, res)
|
|||||||
switch (pai->ai_family) {
|
switch (pai->ai_family) {
|
||||||
#ifdef INET6
|
#ifdef INET6
|
||||||
case AF_INET6:
|
case AF_INET6:
|
||||||
scope = if_nametoindex(hostname2);
|
scope = if_nametoindex(cp);
|
||||||
if (scope == 0) {
|
if (scope == 0) {
|
||||||
error = EAI_SYSTEM;
|
error = EAI_SYSTEM;
|
||||||
goto free;
|
goto free;
|
||||||
@ -718,7 +718,7 @@ explore_numeric_scope(pai, hostname, servname, res)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
error = explore_numeric(pai, cp, servname, res);
|
error = explore_numeric(pai, hostname2, servname, res);
|
||||||
if (error == 0) {
|
if (error == 0) {
|
||||||
for (cur = *res; cur; cur = cur->ai_next) {
|
for (cur = *res; cur; cur = cur->ai_next) {
|
||||||
#ifdef INET6
|
#ifdef INET6
|
||||||
|
@ -199,14 +199,11 @@ getnameinfo(sa, salen, host, hostlen, serv, servlen, flags)
|
|||||||
+ scopelen > hostlen)
|
+ scopelen > hostlen)
|
||||||
return ENI_MEMORY;
|
return ENI_MEMORY;
|
||||||
/*
|
/*
|
||||||
* Shift the host string to allocate
|
* Construct <numeric-addr><delim><scopeid>
|
||||||
* space for the scope ID part.
|
|
||||||
*/
|
*/
|
||||||
memmove(host + scopelen + 1, host, numaddrlen);
|
memcpy(host + numaddrlen + 1, ifname, scopelen);
|
||||||
/* copy the scope ID and the delimiter */
|
host[numaddrlen] = SCOPE_DELIMITER;
|
||||||
memcpy(host, ifname, scopelen);
|
host[numaddrlen + 1 + scopelen] = '\0';
|
||||||
host[scopelen] = SCOPE_DELIMITER;
|
|
||||||
host[scopelen + 1 + numaddrlen] = '\0';
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif /* INET6 */
|
#endif /* INET6 */
|
||||||
|
@ -79,7 +79,7 @@ decstring {digit}+
|
|||||||
hexpair {hexdigit}{hexdigit}
|
hexpair {hexdigit}{hexdigit}
|
||||||
hexstring 0[xX]{hexdigit}+
|
hexstring 0[xX]{hexdigit}+
|
||||||
octetstring {octet}({dot}{octet})+
|
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}))*
|
name {letter}(({letter}|{digit}|{hyphen})*({letter}|{digit}))*
|
||||||
hostname {name}(({dot}{name})+{dot}?)?
|
hostname {name}(({dot}{name})+{dot}?)?
|
||||||
|
|
||||||
|
@ -108,7 +108,7 @@ hexstring 0[xX]{hexdigit}+
|
|||||||
octetstring {octet}({dot}{octet})+
|
octetstring {octet}({dot}{octet})+
|
||||||
ipaddress {ipv4addr}|{ipv6addr}
|
ipaddress {ipv4addr}|{ipv6addr}
|
||||||
ipv4addr {digit}{1,3}({dot}{digit}{1,3}){0,3}
|
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}
|
ipaddrmask {slash}{digit}{1,3}
|
||||||
ipaddrport {blcl}{decstring}{elcl}
|
ipaddrport {blcl}{decstring}{elcl}
|
||||||
keyword {letter}{letter}+
|
keyword {letter}{letter}+
|
||||||
|
@ -108,7 +108,7 @@ hexstring 0[xX]{hexdigit}+
|
|||||||
octetstring {octet}({dot}{octet})+
|
octetstring {octet}({dot}{octet})+
|
||||||
ipaddress {ipv4addr}|{ipv6addr}
|
ipaddress {ipv4addr}|{ipv6addr}
|
||||||
ipv4addr {digit}{1,3}({dot}{digit}{1,3}){0,3}
|
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}
|
ipaddrmask {slash}{digit}{1,3}
|
||||||
ipaddrport {blcl}{decstring}{elcl}
|
ipaddrport {blcl}{decstring}{elcl}
|
||||||
keyword {letter}{letter}+
|
keyword {letter}{letter}+
|
||||||
|
Loading…
Reference in New Issue
Block a user