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 /sys | |
parent | 4a2f410998b7a92693b3a6f02f1ed031455054d8 (diff) |
introduce sysctl net.inet6.ip6.multicast_mtudisc (for multicast routers).
deraadt ok. manpage nit by jmc.
Diffstat (limited to 'sys')
-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 |
4 files changed, 22 insertions, 19 deletions
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 */ |