diff options
Diffstat (limited to 'sys/netinet6')
-rw-r--r-- | sys/netinet6/icmp6.c | 20 | ||||
-rw-r--r-- | sys/netinet6/in6.h | 7 | ||||
-rw-r--r-- | sys/netinet6/in6_proto.c | 11 | ||||
-rw-r--r-- | sys/netinet6/ip6_input.c | 13 | ||||
-rw-r--r-- | sys/netinet6/ip6_var.h | 5 |
5 files changed, 29 insertions, 27 deletions
diff --git a/sys/netinet6/icmp6.c b/sys/netinet6/icmp6.c index 03434510f91..71c8abb8868 100644 --- a/sys/netinet6/icmp6.c +++ b/sys/netinet6/icmp6.c @@ -1,4 +1,4 @@ -/* $OpenBSD: icmp6.c,v 1.132 2013/10/21 08:42:25 phessler Exp $ */ +/* $OpenBSD: icmp6.c,v 1.133 2013/10/21 12:27:14 deraadt Exp $ */ /* $KAME: icmp6.c,v 1.217 2001/06/20 15:03:29 jinmei Exp $ */ /* @@ -148,8 +148,7 @@ struct icmp6_mtudisc_callback { LIST_HEAD(, icmp6_mtudisc_callback) icmp6_mtudisc_callbacks = LIST_HEAD_INITIALIZER(icmp6_mtudisc_callbacks); -static struct rttimer_queue *icmp6_mtudisc_timeout_q = NULL; -extern int pmtu_expire; +struct rttimer_queue *icmp6_mtudisc_timeout_q = NULL; /* XXX do these values make any sense? */ static int icmp6_mtudisc_hiwat = 1280; @@ -184,7 +183,7 @@ void icmp6_init(void) { mld6_init(); - icmp6_mtudisc_timeout_q = rt_timer_queue_create(pmtu_expire); + icmp6_mtudisc_timeout_q = rt_timer_queue_create(ip6_mtudisc_timeout); icmp6_redirect_timeout_q = rt_timer_queue_create(icmp6_redirtimeout); } @@ -2744,18 +2743,11 @@ icmp6_ctloutput(int op, struct socket *so, int level, int optname, int icmp6_ratelimit(const struct in6_addr *dst, const int type, const int code) { - int ret; - - ret = 0; /* okay to send */ - /* PPS limit */ if (!ppsratecheck(&icmp6errppslim_last, &icmp6errpps_count, - icmp6errppslim)) { - /* The packet is subject to rate limit */ - ret++; - } - - return ret; + icmp6errppslim)) + return 1; /* The packet is subject to rate limit */ + return 0; /* okay to send */ } struct rtentry * diff --git a/sys/netinet6/in6.h b/sys/netinet6/in6.h index 6468dbe1ba9..94e3cdf9070 100644 --- a/sys/netinet6/in6.h +++ b/sys/netinet6/in6.h @@ -1,4 +1,4 @@ -/* $OpenBSD: in6.h,v 1.65 2013/06/26 09:12:40 henning Exp $ */ +/* $OpenBSD: in6.h,v 1.66 2013/10/21 12:27:15 deraadt Exp $ */ /* $KAME: in6.h,v 1.83 2001/03/29 02:55:07 jinmei Exp $ */ /* @@ -640,7 +640,8 @@ struct ip6_mtuinfo { #define IPV6CTL_MAXIFDEFROUTERS 47 #define IPV6CTL_MAXDYNROUTES 48 #define IPV6CTL_DAD_PENDING 49 -#define IPV6CTL_MAXID 50 +#define IPV6CTL_MTUDISCTIMEOUT 50 +#define IPV6CTL_MAXID 51 /* New entries should be added here from current IPV6CTL_MAXID value. */ /* to define items, should talk with KAME guys first, for *BSD compatibility */ @@ -696,6 +697,7 @@ struct ip6_mtuinfo { { "maxifdefrouters", CTLTYPE_INT }, \ { "maxdynroutes", CTLTYPE_INT }, \ { "dad_pending", CTLTYPE_INT }, \ + { "mtudisctimeout", CTLTYPE_INT }, \ } #define IPV6CTL_VARS { \ @@ -749,6 +751,7 @@ struct ip6_mtuinfo { &ip6_maxifdefrouters, \ &ip6_maxdynroutes, \ NULL, \ + NULL, \ } #endif /* __BSD_VISIBLE */ diff --git a/sys/netinet6/in6_proto.c b/sys/netinet6/in6_proto.c index c59660c9479..e15f90caccb 100644 --- a/sys/netinet6/in6_proto.c +++ b/sys/netinet6/in6_proto.c @@ -1,4 +1,4 @@ -/* $OpenBSD: in6_proto.c,v 1.68 2013/10/17 16:27:45 bluhm Exp $ */ +/* $OpenBSD: in6_proto.c,v 1.69 2013/10/21 12:27:15 deraadt Exp $ */ /* $KAME: in6_proto.c,v 1.66 2000/10/10 15:35:47 itojun Exp $ */ /* @@ -294,14 +294,6 @@ int ip6_maxifdefrouters = 16; /* Max acceptable def routers via RA */ int ip6_maxdynroutes = 4096; /* Max # of routes created via redirect */ time_t ip6_log_time = (time_t)0L; -/* icmp6 */ -/* - * BSDI4 defines these variables in in_proto.c... - * XXX: what if we don't define INET? Should we define pmtu6_expire - * or so? (jinmei@kame.net 19990310) - */ -int pmtu_expire = 60*10; - /* raw IP6 parameters */ /* * Nominal space allocated to a raw ip socket. @@ -317,3 +309,4 @@ int icmp6_rediraccept = 0; /* don't process redirects by default */ int icmp6_redirtimeout = 10 * 60; /* 10 minutes */ int icmp6errppslim = 100; /* 100pps */ int icmp6_nodeinfo = 1; /* enable/disable NI response */ +int ip6_mtudisc_timeout = IPMTUDISCTIMEOUT; diff --git a/sys/netinet6/ip6_input.c b/sys/netinet6/ip6_input.c index d8915befeb9..3ed6bd301b9 100644 --- a/sys/netinet6/ip6_input.c +++ b/sys/netinet6/ip6_input.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip6_input.c,v 1.116 2013/10/19 21:25:15 bluhm Exp $ */ +/* $OpenBSD: ip6_input.c,v 1.117 2013/10/21 12:27:16 deraadt Exp $ */ /* $KAME: ip6_input.c,v 1.188 2001/03/29 05:34:31 itojun Exp $ */ /* @@ -1358,6 +1358,7 @@ ip6_sysctl(int *name, u_int namelen, void *oldp, size_t *oldlenp, extern int ip6_mrtproto; extern struct mrt6stat mrt6stat; #endif + int error, s; /* All sysctl names at this level are terminal. */ if (namelen != 1) @@ -1390,6 +1391,16 @@ ip6_sysctl(int *name, u_int namelen, void *oldp, size_t *oldlenp, #else return (EOPNOTSUPP); #endif + case IPV6CTL_MTUDISCTIMEOUT: + error = sysctl_int(oldp, oldlenp, newp, newlen, + &ip6_mtudisc_timeout); + if (icmp6_mtudisc_timeout_q != NULL) { + s = splsoftnet(); + rt_timer_queue_change(icmp6_mtudisc_timeout_q, + ip6_mtudisc_timeout); + splx(s); + } + return (error); default: if (name[0] < IPV6CTL_MAXID) return (sysctl_int_arr(ipv6ctl_vars, name, namelen, diff --git a/sys/netinet6/ip6_var.h b/sys/netinet6/ip6_var.h index d464e29fc3e..04d43031e48 100644 --- a/sys/netinet6/ip6_var.h +++ b/sys/netinet6/ip6_var.h @@ -1,4 +1,4 @@ -/* $OpenBSD: ip6_var.h,v 1.46 2013/06/01 16:22:05 bluhm Exp $ */ +/* $OpenBSD: ip6_var.h,v 1.47 2013/10/21 12:27:16 deraadt Exp $ */ /* $KAME: ip6_var.h,v 1.33 2000/06/11 14:59:20 jinmei Exp $ */ /* @@ -219,6 +219,9 @@ struct ip6stat { #define IPV6_FORWARDING 0x02 /* most of IPv6 header exists */ #define IPV6_MINMTU 0x04 /* use minimum MTU (IPV6_USE_MIN_MTU) */ +extern int ip6_mtudisc_timeout; /* mtu discovery */ +extern struct rttimer_queue *icmp6_mtudisc_timeout_q; + extern struct ip6stat ip6stat; /* statistics */ extern int ip6_defhlim; /* default hop limit */ extern int ip6_defmcasthlim; /* default multicast hop limit */ |