summaryrefslogtreecommitdiffstats
path: root/sys/netinet/tcp_output.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/netinet/tcp_output.c')
-rw-r--r--sys/netinet/tcp_output.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/sys/netinet/tcp_output.c b/sys/netinet/tcp_output.c
index 089c7ea..0f889b4 100644
--- a/sys/netinet/tcp_output.c
+++ b/sys/netinet/tcp_output.c
@@ -864,6 +864,21 @@ send:
(so->so_options & SO_DONTROUTE), 0);
}
if (error) {
+
+ /*
+ * We know that the packet was lost, so back out the
+ * sequence number advance, if any.
+ */
+ if (tp->t_force == 0 || !callout_active(tp->tt_persist)) {
+ /*
+ * No need to check for TH_FIN here because
+ * the TF_SENTFIN flag handles that case.
+ */
+ if (flags & TH_SYN)
+ tp->snd_nxt--;
+ tp->snd_nxt -= len;
+ }
+
out:
if (error == ENOBUFS) {
if (!callout_active(tp->tt_rexmt) &&
OpenPOWER on IntegriCloud