summaryrefslogtreecommitdiffstats
path: root/sys/netinet6
diff options
context:
space:
mode:
authorqingli <qingli@FreeBSD.org>2009-09-05 17:35:31 +0000
committerqingli <qingli@FreeBSD.org>2009-09-05 17:35:31 +0000
commitf0151a753a1da765083d09938117b682f38a48a1 (patch)
tree30944e3a4cde97b590a991495afa145280072435 /sys/netinet6
parent66f76404df6720f0882ae280efe98a144122d75e (diff)
downloadFreeBSD-src-f0151a753a1da765083d09938117b682f38a48a1.zip
FreeBSD-src-f0151a753a1da765083d09938117b682f38a48a1.tar.gz
MFC r196865
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 Approved by: re
Diffstat (limited to 'sys/netinet6')
-rw-r--r--sys/netinet6/icmp6.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/sys/netinet6/icmp6.c b/sys/netinet6/icmp6.c
index 6f13c69..04810c3 100644
--- a/sys/netinet6/icmp6.c
+++ b/sys/netinet6/icmp6.c
@@ -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;
OpenPOWER on IntegriCloud