diff options
author | Jun-ichiro itojun Hagino <itojun@cvs.openbsd.org> | 2006-11-21 05:37:33 +0000 |
---|---|---|
committer | Jun-ichiro itojun Hagino <itojun@cvs.openbsd.org> | 2006-11-21 05:37:33 +0000 |
commit | 5106bfd2a82d71f80176091cb8e5b19d9d7bacf8 (patch) | |
tree | cab8391611be94d2860bca14dbb5ad0343fa1ddc | |
parent | 4a2f410998b7a92693b3a6f02f1ed031455054d8 (diff) |
introduce sysctl net.inet6.ip6.multicast_mtudisc (for multicast routers).
deraadt ok. manpage nit by jmc.
-rw-r--r-- | lib/libc/gen/sysctl.3 | 10 | ||||
-rw-r--r-- | sbin/sysctl/sysctl.8 | 3 | ||||
-rw-r--r-- | sys/netinet6/in6.h | 7 | ||||
-rw-r--r-- | sys/netinet6/in6_proto.c | 3 | ||||
-rw-r--r-- | sys/netinet6/ip6_mroute.c | 28 | ||||
-rw-r--r-- | sys/netinet6/ip6_var.h | 3 |
6 files changed, 33 insertions, 21 deletions
diff --git a/lib/libc/gen/sysctl.3 b/lib/libc/gen/sysctl.3 index fdb9ad92689..34779660330 100644 --- a/lib/libc/gen/sysctl.3 +++ b/lib/libc/gen/sysctl.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: sysctl.3,v 1.161 2006/10/16 04:55:21 mcbride Exp $ +.\" $OpenBSD: sysctl.3,v 1.162 2006/11/21 05:37:32 itojun Exp $ .\" .\" Copyright (c) 1993 .\" The Regents of the University of California. All rights reserved. @@ -1556,6 +1556,7 @@ The currently defined protocols and names are: .It ip6 maxfragpackets integer yes .It ip6 maxfrags integer yes .It ip6 mforwarding integer yes +.It ip6 multicast_mtudisc integer yes .It ip6 multipath integer yes .It ip6 redirect integer yes .It ip6 rr_prune integer yes @@ -1740,6 +1741,13 @@ The flag is provided basically for avoiding possible DoS attacks. If set to 1, then multicast forwarding is enabled for the host. The default is 0. .Pp +.It Li ip6.multicast_mtudisc +This variable controls generation of ICMPv6 Too Big messages +when the machine is performing as an IPv6 multicast router. +If set to 1, an ICMPv6 Too Big message will be generated for multicast packets +which were too big to be forwarded. +If set to 0, the ICMPv6 Too Big message will be suppressed. +.Pp .It Li ip6.multipath This variable enables multipath routing for IPv6 addresses. If set to 0, only the first route selected will be used for a given diff --git a/sbin/sysctl/sysctl.8 b/sbin/sysctl/sysctl.8 index 6d35d7cb9a9..b1f7eccad10 100644 --- a/sbin/sysctl/sysctl.8 +++ b/sbin/sysctl/sysctl.8 @@ -1,4 +1,4 @@ -.\" $OpenBSD: sysctl.8,v 1.134 2006/10/16 08:24:14 jmc Exp $ +.\" $OpenBSD: sysctl.8,v 1.135 2006/11/21 05:37:32 itojun Exp $ .\" $NetBSD: sysctl.8,v 1.4 1995/09/30 07:12:49 thorpej Exp $ .\" .\" Copyright (c) 1993 @@ -305,6 +305,7 @@ not all of the variables are relevant to all architectures. .It net.inet6.ip6.maxfrags integer yes .It net.inet6.ip6.mforwarding integer yes .It net.inet6.ip6.multipath integer yes +.It net.inet6.ip6.multicast_mtudisc integer yes .It net.inet6.icmp6.rediraccept integer yes .It net.inet6.icmp6.redirtimeout integer yes .It net.inet6.icmp6.nd6_prune integer yes diff --git a/sys/netinet6/in6.h b/sys/netinet6/in6.h index d965b80af50..a723cf2e143 100644 --- a/sys/netinet6/in6.h +++ b/sys/netinet6/in6.h @@ -1,4 +1,4 @@ -/* $OpenBSD: in6.h,v 1.41 2006/11/17 02:00:21 itojun Exp $ */ +/* $OpenBSD: in6.h,v 1.42 2006/11/21 05:37:32 itojun Exp $ */ /* $KAME: in6.h,v 1.83 2001/03/29 02:55:07 jinmei Exp $ */ /* @@ -565,7 +565,8 @@ struct in6_pktinfo { #define IPV6CTL_MAXFRAGS 41 /* max fragments */ #define IPV6CTL_MFORWARDING 42 #define IPV6CTL_MULTIPATH 43 -#define IPV6CTL_MAXID 44 +#define IPV6CTL_MCAST_PMTU 44 /* path MTU discovery for multicast */ +#define IPV6CTL_MAXID 45 /* New entries should be added here from current IPV6CTL_MAXID value. */ /* to define items, should talk with KAME guys first, for *BSD compatibility */ @@ -614,6 +615,7 @@ struct in6_pktinfo { { "maxfrags", CTLTYPE_INT }, \ { "mforwarding", CTLTYPE_INT }, \ { "multipath", CTLTYPE_INT }, \ + { "multicast_mtudisc", CTLTYPE_INT }, \ } #define IPV6CTL_VARS { \ @@ -661,6 +663,7 @@ struct in6_pktinfo { &ip6_maxfrags, \ &ip6_mforwarding, \ &ip6_multipath, \ + &ip6_mcast_pmtu, \ } #endif /* __BSD_VISIBLE */ diff --git a/sys/netinet6/in6_proto.c b/sys/netinet6/in6_proto.c index 1a881003002..bb0732d367c 100644 --- a/sys/netinet6/in6_proto.c +++ b/sys/netinet6/in6_proto.c @@ -1,4 +1,4 @@ -/* $OpenBSD: in6_proto.c,v 1.50 2006/06/18 11:47:46 pascoe Exp $ */ +/* $OpenBSD: in6_proto.c,v 1.51 2006/11/21 05:37:32 itojun Exp $ */ /* $KAME: in6_proto.c,v 1.66 2000/10/10 15:35:47 itojun Exp $ */ /* @@ -269,6 +269,7 @@ int ip6_auto_flowlabel = 1; int ip6_use_deprecated = 1; /* allow deprecated addr (RFC2462 5.5.4) */ int ip6_rr_prune = 5; /* router renumbering prefix * walk list every 5 sec. */ +int ip6_mcast_pmtu = 0; /* enable pMTU discovery for multicast? */ const int ip6_v6only = 1; u_int32_t ip6_id = 0UL; int ip6_keepfaith = 0; diff --git a/sys/netinet6/ip6_mroute.c b/sys/netinet6/ip6_mroute.c index 3585cc24a3d..81f049e213b 100644 --- a/sys/netinet6/ip6_mroute.c +++ b/sys/netinet6/ip6_mroute.c @@ -106,9 +106,7 @@ #include <netinet/in.h> #include <netinet/in_var.h> -#ifdef MULTICAST_PMTUD #include <netinet/icmp6.h> -#endif #include <netinet/ip6.h> #include <netinet6/ip6_var.h> @@ -1595,21 +1593,21 @@ phyint_send(ip6, mifp, m) mifp - mif6table, error); #endif } else { -#ifdef MULTICAST_PMTUD - icmp6_error(mb_copy, ICMP6_PACKET_TOO_BIG, 0, linkmtu); -#else + if (ip6_mcast_pmtu) + icmp6_error(mb_copy, ICMP6_PACKET_TOO_BIG, 0, linkmtu); + else { #ifdef MRT6DEBUG - if (mrt6debug & DEBUG_XMIT) - log(LOG_DEBUG, - "phyint_send: packet too big on %s o %s g %s" - " size %d(discarded)\n", - ifp->if_xname, - ip6_sprintf(&ip6->ip6_src), - ip6_sprintf(&ip6->ip6_dst), - mb_copy->m_pkthdr.len); + if (mrt6debug & DEBUG_XMIT) + log(LOG_DEBUG, + "phyint_send: packet too big on %s o %s g %s" + " size %d(discarded)\n", + ifp->if_xname, + ip6_sprintf(&ip6->ip6_src), + ip6_sprintf(&ip6->ip6_dst), + mb_copy->m_pkthdr.len); #endif /* MRT6DEBUG */ - m_freem(mb_copy); /* simply discard the packet */ -#endif + m_freem(mb_copy); /* simply discard the packet */ + } } splx(s); diff --git a/sys/netinet6/ip6_var.h b/sys/netinet6/ip6_var.h index a4268785a62..2f4c92181c5 100644 --- a/sys/netinet6/ip6_var.h +++ b/sys/netinet6/ip6_var.h @@ -1,4 +1,4 @@ -/* $OpenBSD: ip6_var.h,v 1.28 2006/07/06 02:56:58 brad Exp $ */ +/* $OpenBSD: ip6_var.h,v 1.29 2006/11/21 05:37:32 itojun Exp $ */ /* $KAME: ip6_var.h,v 1.33 2000/06/11 14:59:20 jinmei Exp $ */ /* @@ -213,6 +213,7 @@ 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 * walk list every 5 sec. */ +extern int ip6_mcast_pmtu; /* path MTU discovery for multicast */ extern const int ip6_v6only; extern struct socket *ip6_mrouter; /* multicast routing daemon */ |