This patch fixes an address scope violation. Considering the

scenario where an anycast address is assigned on one interface,
and a global address with the same scope is assigned on another
interface. In other words, the interface owns the anycast
address has only the link-local address as one other address.
Without this patch, "ping6" the anycast address from another
station will observe the source address of the returned ICMP6
echo reply has the link-local address, not the global address
that exists on the other interface in the same node.

Reviewed by:	bz
MFC after:	immediately
This commit is contained in:
Qing Li 2009-09-05 16:50:55 +00:00
parent 9452b0d2de
commit 7dcdecb107
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=196865

View File

@ -2170,6 +2170,10 @@ icmp6_reflect(struct mbuf *m, size_t off)
}
}
if ((srcp != NULL) &&
(in6_addrscope(srcp) != in6_addrscope(&ip6->ip6_src)))
srcp = NULL;
if (srcp == NULL) {
int e;
struct sockaddr_in6 sin6;