summaryrefslogtreecommitdiffstats
path: root/sys/netinet/tcp_input.c
diff options
context:
space:
mode:
authorbluhm <bluhm@openbsd.org>2019-07-12 19:43:51 +0000
committerbluhm <bluhm@openbsd.org>2019-07-12 19:43:51 +0000
commit0c04e3b6d529d6955faf3e86aabe4172550afff8 (patch)
treeb85906185cb4b5d83ba9c1841169d77fffc991b5 /sys/netinet/tcp_input.c
parentTest should also run if there is no obj directory. Name regress (diff)
downloadwireguard-openbsd-0c04e3b6d529d6955faf3e86aabe4172550afff8.tar.xz
wireguard-openbsd-0c04e3b6d529d6955faf3e86aabe4172550afff8.zip
Count the number of TCP SACK options that were dropped due to the
sack hole list length or pool limit. OK claudio@
Diffstat (limited to 'sys/netinet/tcp_input.c')
-rw-r--r--sys/netinet/tcp_input.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c
index 1726d653da0..aeff9ed3b54 100644
--- a/sys/netinet/tcp_input.c
+++ b/sys/netinet/tcp_input.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tcp_input.c,v 1.360 2019/07/10 18:45:31 bluhm Exp $ */
+/* $OpenBSD: tcp_input.c,v 1.361 2019/07/12 19:43:51 bluhm Exp $ */
/* $NetBSD: tcp_input.c,v 1.23 1996/02/13 23:43:44 christos Exp $ */
/*
@@ -2414,8 +2414,8 @@ tcp_sack_option(struct tcpcb *tp, struct tcphdr *th, u_char *cp, int optlen)
tp->snd_holes = (struct sackhole *)
pool_get(&sackhl_pool, PR_NOWAIT);
if (tp->snd_holes == NULL) {
- /* ENOBUFS, so ignore SACKed block for now*/
- goto done;
+ /* ENOBUFS, so ignore SACKed block for now */
+ goto dropped;
}
cur = tp->snd_holes;
cur->start = th->th_ack;
@@ -2493,11 +2493,11 @@ tcp_sack_option(struct tcpcb *tp, struct tcphdr *th, u_char *cp, int optlen)
* split current hole
*/
if (tp->snd_numholes >= TCP_SACKHOLE_LIMIT)
- goto done;
+ goto dropped;
temp = (struct sackhole *)
pool_get(&sackhl_pool, PR_NOWAIT);
if (temp == NULL)
- goto done; /* ENOBUFS */
+ goto dropped; /* ENOBUFS */
temp->next = cur->next;
temp->start = sack.end;
temp->end = cur->end;
@@ -2522,11 +2522,11 @@ tcp_sack_option(struct tcpcb *tp, struct tcphdr *th, u_char *cp, int optlen)
* Last hole is p (and it's not NULL).
*/
if (tp->snd_numholes >= TCP_SACKHOLE_LIMIT)
- goto done;
+ goto dropped;
temp = (struct sackhole *)
pool_get(&sackhl_pool, PR_NOWAIT);
if (temp == NULL)
- goto done; /* ENOBUFS */
+ goto dropped; /* ENOBUFS */
temp->start = tp->rcv_lastsack;
temp->end = sack.start;
temp->dups = min(tcprexmtthresh,
@@ -2540,8 +2540,9 @@ tcp_sack_option(struct tcpcb *tp, struct tcphdr *th, u_char *cp, int optlen)
tp->snd_numholes++;
}
}
-done:
return;
+dropped:
+ tcpstat_inc(tcps_sack_drop_opts);
}
/*