summaryrefslogtreecommitdiffstats
path: root/sys/netinet6/icmp6.c
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2013-10-21 12:27:11 +0000
committerderaadt <deraadt@openbsd.org>2013-10-21 12:27:11 +0000
commit0e446ca263cfe2a96d5d4b8903d44bf807605d9c (patch)
treec2fda4f9f531844950c1a245ae586161a3754c2a /sys/netinet6/icmp6.c
parentFix lies in comments, and apply some KNF and unused or duplicate prototype (diff)
downloadwireguard-openbsd-0e446ca263cfe2a96d5d4b8903d44bf807605d9c.tar.xz
wireguard-openbsd-0e446ca263cfe2a96d5d4b8903d44bf807605d9c.zip
There are gasps of shock! Add a pmtu delay sysctl BUTTON for netinet6,
making the code the same as netinet4 along the way. ok bluhm phessler
Diffstat (limited to 'sys/netinet6/icmp6.c')
-rw-r--r--sys/netinet6/icmp6.c20
1 files changed, 6 insertions, 14 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 *