summaryrefslogtreecommitdiff
path: root/sys/netinet6/ip6_forward.c
diff options
context:
space:
mode:
authorJun-ichiro itojun Hagino <itojun@cvs.openbsd.org>2001-07-18 09:56:50 +0000
committerJun-ichiro itojun Hagino <itojun@cvs.openbsd.org>2001-07-18 09:56:50 +0000
commit33fbe5eea52c9938f6f888b886db7cbe2583b9d3 (patch)
treef347239f43c62d9fe0c55c11ae31e108fccdee49 /sys/netinet6/ip6_forward.c
parente7cd4db9a47ba320e3f0bb0433fb0e3c1390b953 (diff)
sync with draft-ietf-ipngwg-p2p-pingpong-00.txt. apply special behavior
only if ip6_dst is "neighbor" within p2p prefix. sync with kame
Diffstat (limited to 'sys/netinet6/ip6_forward.c')
-rw-r--r--sys/netinet6/ip6_forward.c22
1 files changed, 14 insertions, 8 deletions
diff --git a/sys/netinet6/ip6_forward.c b/sys/netinet6/ip6_forward.c
index cec57d936f6..4cae2928d24 100644
--- a/sys/netinet6/ip6_forward.c
+++ b/sys/netinet6/ip6_forward.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: ip6_forward.c,v 1.15 2001/06/22 12:30:34 itojun Exp $ */
-/* $KAME: ip6_forward.c,v 1.74 2001/06/12 23:54:55 itojun Exp $ */
+/* $OpenBSD: ip6_forward.c,v 1.16 2001/07/18 09:56:49 itojun Exp $ */
+/* $KAME: ip6_forward.c,v 1.75 2001/06/29 12:42:13 jinmei Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -413,14 +413,20 @@ ip6_forward(m, srcrt)
*/
if (rt->rt_ifp == m->m_pkthdr.rcvif && !srcrt &&
(rt->rt_flags & (RTF_DYNAMIC|RTF_MODIFIED)) == 0) {
- if ((rt->rt_ifp->if_flags & IFF_POINTOPOINT) != 0) {
+ if ((rt->rt_ifp->if_flags & IFF_POINTOPOINT) &&
+ nd6_is_addr_neighbor((struct sockaddr_in6 *)&ip6_forward_rt.ro_dst, rt->rt_ifp)) {
/*
* If the incoming interface is equal to the outgoing
- * one, and the link attached to the interface is
- * point-to-point, then it will be highly probable
- * that a routing loop occurs. Thus, we immediately
- * drop the packet and send an ICMPv6 error message.
- *
+ * one, the link attached to the interface is
+ * point-to-point, and the IPv6 destination is
+ * regarded as on-link on the link, then it will be
+ * highly probable that the destination address does
+ * not exist on the link and that the packet is going
+ * to loop. Thus, we immediately drop the packet and
+ * send an ICMPv6 error message.
+ * For other routing loops, we dare to let the packet
+ * go to the loop, so that a remote diagnosing host
+ * can detect the loop by traceroute.
* type/code is based on suggestion by Rich Draves.
* not sure if it is the best pick.
*/