summaryrefslogtreecommitdiffstats
path: root/sys/netinet6/ip6_output.c
diff options
context:
space:
mode:
authorqingli <qingli@FreeBSD.org>2009-09-05 17:40:27 +0000
committerqingli <qingli@FreeBSD.org>2009-09-05 17:40:27 +0000
commit854d705b6c5997a91e7f08ef9f3d078180076d1c (patch)
treea690d8ca56f1ba36df72afc3d33e73675ae2a00f /sys/netinet6/ip6_output.c
parentf0151a753a1da765083d09938117b682f38a48a1 (diff)
downloadFreeBSD-src-854d705b6c5997a91e7f08ef9f3d078180076d1c.zip
FreeBSD-src-854d705b6c5997a91e7f08ef9f3d078180076d1c.tar.gz
MFC r196864
This patch fixes the following issues: - Interface link-local address is not reachable within the node that owns the interface, this is due to the mismatch in address scope as the result of the installed interface address loopback route. Therefore for each interface address loopback route, the rt_gateway field (of AF_LINK type) will be used to track which interface a given address belongs to. This will aid the address source to use the proper interface for address scope/zone validation. - The loopback address is not reachable. The root cause is the same as the above. - Empty nd6 entries are created for the IPv6 loopback addresses only for validation reason. Doing so will eliminate as much of the special case (loopback addresses) handling code as possible, however, these empty nd6 entries should not be returned to the userland applications such as the "ndp" command. Since both of the above issues contain common files, these files are committed together. Reviewed by: bz Approved by: re
Diffstat (limited to 'sys/netinet6/ip6_output.c')
-rw-r--r--sys/netinet6/ip6_output.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/sys/netinet6/ip6_output.c b/sys/netinet6/ip6_output.c
index c48ac7b..9887564 100644
--- a/sys/netinet6/ip6_output.c
+++ b/sys/netinet6/ip6_output.c
@@ -602,15 +602,12 @@ again:
rt->rt_use++;
}
+
/*
* The outgoing interface must be in the zone of source and
- * destination addresses. We should use ia_ifp to support the
- * case of sending packets to an address of our own.
+ * destination addresses.
*/
- if (ia != NULL && ia->ia_ifp)
- origifp = ia->ia_ifp;
- else
- origifp = ifp;
+ origifp = ifp;
src0 = ip6->ip6_src;
if (in6_setscope(&src0, origifp, &zone))
@@ -634,6 +631,12 @@ again:
goto badscope;
}
+ /* We should use ia_ifp to support the case of
+ * sending packets to an address of our own.
+ */
+ if (ia != NULL && ia->ia_ifp)
+ ifp = ia->ia_ifp;
+
/* scope check is done. */
goto routefound;
OpenPOWER on IntegriCloud