Treat IPv4 private address as global scope rather than site scope.

Though it breaks RFC 3484, without this change, dest addr selection
doesn't work well under NAT environment.
This commit is contained in:
Hajimu UMEMOTO 2004-05-31 21:09:14 +00:00
parent e79962dbce
commit 251b48a1bb
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=129905

View File

@ -1089,7 +1089,7 @@ gai_addr2scopetype(sa)
(((u_char *)&sa4->sin_addr)[1] & 0xf0) == 16) ||
(((u_char *)&sa4->sin_addr)[0] == 192 &&
((u_char *)&sa4->sin_addr)[1] == 168))
return(5);
return(14); /* XXX: It should be 5 unless NAT */
/* Loopback addresses have link-local scope. */
if (((u_char *)&sa4->sin_addr)[0] == 127)
return(2);