summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJun-ichiro itojun Hagino <itojun@cvs.openbsd.org>2003-08-07 09:11:54 +0000
committerJun-ichiro itojun Hagino <itojun@cvs.openbsd.org>2003-08-07 09:11:54 +0000
commit6c2c485cabdbeeaa2c3705d6e53cf7f4862abe8d (patch)
tree994300a1e7ab020a935badee72049e47b6c6335f
parent37044f9dc4154656f80f64756350415c67477404 (diff)
make net.inet6.ip6.redirect actually work. from kame
-rw-r--r--sys/netinet6/in6_proto.c8
-rw-r--r--sys/netinet6/ip6_forward.c4
-rw-r--r--sys/netinet6/ip6_var.h3
3 files changed, 6 insertions, 9 deletions
diff --git a/sys/netinet6/in6_proto.c b/sys/netinet6/in6_proto.c
index 8982aa4a08f..50bdd85af92 100644
--- a/sys/netinet6/in6_proto.c
+++ b/sys/netinet6/in6_proto.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: in6_proto.c,v 1.41 2003/06/02 23:28:15 millert Exp $ */
+/* $OpenBSD: in6_proto.c,v 1.42 2003/08/07 09:11:53 itojun Exp $ */
/* $KAME: in6_proto.c,v 1.66 2000/10/10 15:35:47 itojun Exp $ */
/*
@@ -238,12 +238,8 @@ struct domain inet6domain =
#endif /* GATEWAY6 */
#endif /* !IPV6FORWARDING */
-#ifndef IPV6_SENDREDIRECTS
-#define IPV6_SENDREDIRECTS 1
-#endif
-
int ip6_forwarding = IPV6FORWARDING; /* act as router? */
-int ip6_sendredirects = IPV6_SENDREDIRECTS;
+int ip6_sendredirects = 1;
int ip6_defhlim = IPV6_DEFHLIM;
int ip6_defmcasthlim = IPV6_DEFAULT_MULTICAST_HOPS;
int ip6_accept_rtadv = 0; /* "IPV6FORWARDING ? 0 : 1" is dangerous */
diff --git a/sys/netinet6/ip6_forward.c b/sys/netinet6/ip6_forward.c
index 17b2c5f7e22..514747339c5 100644
--- a/sys/netinet6/ip6_forward.c
+++ b/sys/netinet6/ip6_forward.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip6_forward.c,v 1.26 2003/06/24 07:47:54 itojun Exp $ */
+/* $OpenBSD: ip6_forward.c,v 1.27 2003/08/07 09:11:53 itojun Exp $ */
/* $KAME: ip6_forward.c,v 1.75 2001/06/29 12:42:13 jinmei Exp $ */
/*
@@ -358,7 +358,7 @@ ip6_forward(m, srcrt)
* Also, don't send redirect if forwarding using a route
* modified by a redirect.
*/
- if (rt->rt_ifp == m->m_pkthdr.rcvif && !srcrt &&
+ if (rt->rt_ifp == m->m_pkthdr.rcvif && !srcrt && ip6_sendredirects &&
(rt->rt_flags & (RTF_DYNAMIC|RTF_MODIFIED)) == 0) {
if ((rt->rt_ifp->if_flags & IFF_POINTOPOINT) &&
nd6_is_addr_neighbor((struct sockaddr_in6 *)&ip6_forward_rt.ro_dst, rt->rt_ifp)) {
diff --git a/sys/netinet6/ip6_var.h b/sys/netinet6/ip6_var.h
index 4deb9ffdde1..68b23f2a163 100644
--- a/sys/netinet6/ip6_var.h
+++ b/sys/netinet6/ip6_var.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip6_var.h,v 1.22 2003/06/02 23:28:16 millert Exp $ */
+/* $OpenBSD: ip6_var.h,v 1.23 2003/08/07 09:11:53 itojun Exp $ */
/* $KAME: ip6_var.h,v 1.33 2000/06/11 14:59:20 jinmei Exp $ */
/*
@@ -207,6 +207,7 @@ extern u_int32_t ip6_id; /* fragment identifier */
extern int ip6_defhlim; /* default hop limit */
extern int ip6_defmcasthlim; /* default multicast hop limit */
extern int ip6_forwarding; /* act as router? */
+extern int ip6_sendredirect; /* send ICMPv6 redirect? */
extern int ip6_forward_srcrt; /* forward src-routed? */
extern int ip6_use_deprecated; /* allow deprecated addr as source */
extern int ip6_rr_prune; /* router renumbering prefix