From owner-svn-src-head@freebsd.org Mon May 4 23:02:59 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4E7942C6381; Mon, 4 May 2020 23:02:59 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49GJKv1NSFz3wpx; Mon, 4 May 2020 23:02:59 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2AB4F40FC; Mon, 4 May 2020 23:02:59 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 044N2x1G058401; Mon, 4 May 2020 23:02:59 GMT (envelope-from rrs@FreeBSD.org) Received: (from rrs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 044N2xUC058400; Mon, 4 May 2020 23:02:59 GMT (envelope-from rrs@FreeBSD.org) Message-Id: <202005042302.044N2xUC058400@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rrs set sender to rrs@FreeBSD.org using -f From: Randall Stewart Date: Mon, 4 May 2020 23:02:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360644 - head/sys/netinet/tcp_stacks X-SVN-Group: head X-SVN-Commit-Author: rrs X-SVN-Commit-Paths: head/sys/netinet/tcp_stacks X-SVN-Commit-Revision: 360644 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 May 2020 23:02:59 -0000 Author: rrs Date: Mon May 4 23:02:58 2020 New Revision: 360644 URL: https://svnweb.freebsd.org/changeset/base/360644 Log: This fixes two issues found by ankitraheja09@gmail.com 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: ankitraheja09@gmail.com Sponsored by: Netflix.com Differential Revision: https://reviews.freebsd.org/D24693 Modified: head/sys/netinet/tcp_stacks/bbr.c Modified: head/sys/netinet/tcp_stacks/bbr.c ============================================================================== --- head/sys/netinet/tcp_stacks/bbr.c Mon May 4 22:59:39 2020 (r360643) +++ head/sys/netinet/tcp_stacks/bbr.c Mon May 4 23:02:58 2020 (r360644) @@ -12159,6 +12159,7 @@ bbr_output_wtime(struct tcpcb *tp, const struct timeva 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))) { /* @@ -12916,9 +12917,13 @@ recheck_resend: 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; + } /* * If our state indicates that FIN should be sent and we have not * yet done so, then we need to send. @@ -14029,7 +14034,11 @@ out: } 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++;