Skip to content

Commit

Permalink
This fixes two issues found by [email protected]
Browse files Browse the repository at this point in the history
1) When BBR retransmits the syn it was messing up the snd_max
2) When we need to send a RST we might not send it when we should

Reported by:	[email protected]
Sponsored by:  Netflix.com
Differential Revision: https://reviews.freebsd.org/D24693
  • Loading branch information
Randall Stewart authored and Randall Stewart committed May 4, 2020
1 parent ad55705 commit 570045a
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions sys/netinet/tcp_stacks/bbr.c
Original file line number Diff line number Diff line change
Expand Up @@ -12159,6 +12159,7 @@ bbr_output_wtime(struct tcpcb *tp, const struct timeval *tv)
recwin = min(max(sbspace(&so->so_rcv), 0),
TCP_MAXWIN << tp->rcv_scale);
if ((bbr_window_update_needed(tp, so, recwin, maxseg) == 0) &&
((tcp_outflags[tp->t_state] & TH_RST) == 0) &&
((sbavail(sb) + ((tcp_outflags[tp->t_state] & TH_FIN) ? 1 : 0)) <=
(tp->snd_max - tp->snd_una))) {
/*
Expand Down Expand Up @@ -12916,7 +12917,11 @@ bbr_output_wtime(struct tcpcb *tp, const struct timeval *tv)
if (tp->t_flags & TF_ACKNOW) {
goto send;
}
if (((flags & TH_SYN) && (tp->t_flags & TF_NEEDSYN) == 0)) {
if (flags & TH_RST) {
/* Always send a RST if one is due */
goto send;
}
if ((flags & TH_SYN) && (tp->t_flags & TF_NEEDSYN) == 0) {
goto send;
}
/*
Expand Down Expand Up @@ -14029,7 +14034,11 @@ bbr_output_wtime(struct tcpcb *tp, const struct timeval *tv)
}
if (flags & (TH_SYN | TH_FIN) && (rsm == NULL)) {
if (flags & TH_SYN) {
tp->snd_max++;
/*
* Smack the snd_max to iss + 1
* if its a FO we will add len below.
*/
tp->snd_max = tp->iss + 1;
}
if ((flags & TH_FIN) && ((tp->t_flags & TF_SENTFIN) == 0)) {
tp->snd_max++;
Expand Down

0 comments on commit 570045a

Please sign in to comment.