From fc35f336c78a6e5390efc174239db1d79a30050a Mon Sep 17 00:00:00 2001 From: itojun Date: Wed, 18 Jul 2001 09:24:26 +0000 Subject: [PATCH] sync with draft-ietf-ipngwg-p2p-pingpong-00.txt. apply special behavior only if ip6_dst is "neighbor" within p2p prefix. sync with kame --- sys/netinet6/ip6_forward.c | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/sys/netinet6/ip6_forward.c b/sys/netinet6/ip6_forward.c index c6d1133327a1..d4438406bd9b 100644 --- a/sys/netinet6/ip6_forward.c +++ b/sys/netinet6/ip6_forward.c @@ -1,4 +1,4 @@ -/* $NetBSD: ip6_forward.c,v 1.22 2001/06/22 12:33:05 itojun Exp $ */ +/* $NetBSD: ip6_forward.c,v 1.23 2001/07/18 09:24:26 itojun Exp $ */ /* $KAME: ip6_forward.c,v 1.74 2001/06/12 23:54:55 itojun Exp $ */ /* @@ -424,14 +424,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. */