summaryrefslogtreecommitdiff
path: root/sys/netinet6/ip6_forward.c
diff options
context:
space:
mode:
authorJun-ichiro itojun Hagino <itojun@cvs.openbsd.org>2000-06-03 13:42:34 +0000
committerJun-ichiro itojun Hagino <itojun@cvs.openbsd.org>2000-06-03 13:42:34 +0000
commit41139e24cad367ca2f7140351bb0e3808d3831d6 (patch)
treeee2c3a82298945fee2991639a2025798228a0b1e /sys/netinet6/ip6_forward.c
parenta87e5eba6bbd992103852fcfd261289bed60ffc5 (diff)
do not bark even if forwarding to loopback, since it is common
to route packet to be rejected/dropped to loopback. (sync with kame)
Diffstat (limited to 'sys/netinet6/ip6_forward.c')
-rw-r--r--sys/netinet6/ip6_forward.c20
1 files changed, 13 insertions, 7 deletions
diff --git a/sys/netinet6/ip6_forward.c b/sys/netinet6/ip6_forward.c
index 3c4d01f33aa..f411e75d8cb 100644
--- a/sys/netinet6/ip6_forward.c
+++ b/sys/netinet6/ip6_forward.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: ip6_forward.c,v 1.6 2000/05/19 20:12:10 itojun Exp $ */
-/* $KAME: ip6_forward.c,v 1.36 2000/05/19 19:10:06 itojun Exp $ */
+/* $OpenBSD: ip6_forward.c,v 1.7 2000/06/03 13:42:33 itojun Exp $ */
+/* $KAME: ip6_forward.c,v 1.37 2000/05/28 12:17:19 itojun Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -440,12 +440,18 @@ ip6_forward(m, srcrt)
* XXX: but is it possible that ip6_forward() sends a packet
* to a loopback interface? I don't think so, and thus
* I bark here. (jinmei@kame.net)
+ * XXX: it is common to route invalid packets to loopback.
+ * (itojun)
*/
- printf("ip6_forward: outgoing interface is loopback. "
- "src %s, dst %s, nxt %d, rcvif %s, outif %s\n",
- ip6_sprintf(&ip6->ip6_src), ip6_sprintf(&ip6->ip6_dst),
- ip6->ip6_nxt, if_name(m->m_pkthdr.rcvif),
- if_name(rt->rt_ifp));
+
+ if ((rt->rt_flags & (RTF_BLACKHOLE|RTF_REJECT)) == 0) {
+ printf("ip6_forward: outgoing interface is loopback. "
+ "src %s, dst %s, nxt %d, rcvif %s, outif %s\n",
+ ip6_sprintf(&ip6->ip6_src),
+ ip6_sprintf(&ip6->ip6_dst),
+ ip6->ip6_nxt, if_name(m->m_pkthdr.rcvif),
+ if_name(rt->rt_ifp));
+ }
if (IN6_IS_SCOPE_LINKLOCAL(&ip6->ip6_src))
origifp = ifindex2ifnet[ntohs(ip6->ip6_src.s6_addr16[1])];