From nobody Thu Mar 16 16:44:56 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PctQw3c2kz3yK6w; Thu, 16 Mar 2023 16:44:56 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PctQw33Ryz3lZt; Thu, 16 Mar 2023 16:44:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678985096; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OKd9TMSsSIY+xLSbk3c/Snjm/sDuvuULpDPjD784eHg=; b=PYi9sGpiCaaHRd83Q2nNdA35pMWWDhyEnWLosvXapKpbtLCpDl0NTbyA20VGZgwSR0Nk56 5yRch3ZszLENF3FkCAmnupvVG33q8Rva9S3frC6Azsj01Q/R3MV85UXz+aBCxKPrre1s6p PU9YLj9q6XngcaWUrFJ3mOG/oaB/CmKdojSVWUVyeYERZcu+YftQ+xiIePSM5swencaRMG kJQyOC6dL6gxtEJwL+C2zbqR+j/48kU0s18CYyw8FGR/fLmghHhAysgQm59nr7T+0H+0wQ C7G7Zk8BhZCueEufY7DlvtPfCldSVhl774tGA1jwhZf+aO1xmmg4nDj4sSDTmw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678985096; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OKd9TMSsSIY+xLSbk3c/Snjm/sDuvuULpDPjD784eHg=; b=l0QhAheifHcGWf5EknBNSbqiH8S7BXEQmEpB9tti3DUaY1hi9Up/Ars6IgvFIk5ZRuERHF ZSrlBwuvL8Nuq2wmRVnOlRr+XKktxgqPYx/S9b+rH/mK6fcsT2bZoCQWSV9Q+sQ7WIXAwR h4Km/pzrrmuHkyF1/ESmbcBwjDKwse1A44bXdIlhw4LTg/Bu4eDgaMQzHvp6dek4vwaUht bBZYxrS1+eSWBTwbnG4bEWNonTzYuDaAoDzW+nf4hVsip4QCoFGXTpi6l+XalZTha3yfV8 WGJuAzgkxei3sj09SSxqNHi5rVtN4fownX1h4XJdbwZCvwphtglNMcyWFHF9HA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678985096; a=rsa-sha256; cv=none; b=FzYI2BNBToD9FYjvQwxz5O/GJQJlTnCLS2iWXZLwNYXeWxonp1mVJ0wPzWhAtbuzyGy7FC /wx4ZXVTJm6IN3Uhh0uXYtBdKl2JwZIKGMCZz3Mxwz+h0ZH2OPtPs9chb0sjdDGGzZ76ti 5W4xrnuG6wB6ydKcuUmScIci92PWoDHhLPjhRXVai9ziPWMXIsrFOZ/Juc3bF4FGJOYrIg LfHgm70bRz0qnSKGRXNVXnwp3U6BlMFrFP6hfLl+cMzGKEDdPALlMZX7xUasiEbneI50r3 rGsTIiqeXdB4ObVVnFEh/7JAA4DjguHyXpIbjF6wtOGnPD9K8XWoUHik4I5nyw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PctQw26Q3zqg2; Thu, 16 Mar 2023 16:44:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32GGiuvU021905; Thu, 16 Mar 2023 16:44:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32GGiuX5021904; Thu, 16 Mar 2023 16:44:56 GMT (envelope-from git) Date: Thu, 16 Mar 2023 16:44:56 GMT Message-Id: <202303161644.32GGiuX5021904@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Michael Tuexen Subject: git: 8ed1e2c88012 - main - sctp: enforce Kahn's rule during the handshake List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8ed1e2c88012cfca9fc4131a2637452cc9106b81 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=8ed1e2c88012cfca9fc4131a2637452cc9106b81 commit 8ed1e2c88012cfca9fc4131a2637452cc9106b81 Author: Michael Tuexen AuthorDate: 2023-03-16 16:40:40 +0000 Commit: Michael Tuexen CommitDate: 2023-03-16 16:40:40 +0000 sctp: enforce Kahn's rule during the handshake Don't take RTT measurements on packets containing INIT or COOKIE-ECHO chunks, when they were retransmitted. MFC after: 1 week --- sys/netinet/sctp_input.c | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/sys/netinet/sctp_input.c b/sys/netinet/sctp_input.c index 3da483bdf37a..f01c1fe710e4 100644 --- a/sys/netinet/sctp_input.c +++ b/sys/netinet/sctp_input.c @@ -508,8 +508,6 @@ sctp_process_init_ack(struct mbuf *m, int iphlen, int offset, SCTP_FROM_SCTP_INPUT, __LINE__); } - stcb->asoc.overall_error_count = 0; - net->error_count = 0; /* * Cancel the INIT timer, We do this first before queueing the @@ -521,8 +519,12 @@ sctp_process_init_ack(struct mbuf *m, int iphlen, int offset, asoc->primary_destination, SCTP_FROM_SCTP_INPUT + SCTP_LOC_3); /* calculate the RTO */ - sctp_calculate_rto(stcb, asoc, net, &asoc->time_entered, - SCTP_RTT_FROM_NON_DATA); + if (asoc->overall_error_count == 0) { + sctp_calculate_rto(stcb, asoc, net, &asoc->time_entered, + SCTP_RTT_FROM_NON_DATA); + } + stcb->asoc.overall_error_count = 0; + net->error_count = 0; retval = sctp_send_cookie_echo(m, offset, initack_limit, stcb, net); return (retval); } @@ -2758,7 +2760,6 @@ sctp_handle_cookie_ack(struct sctp_cookie_ack_chunk *cp SCTP_UNUSED, SCTP_FROM_SCTP_INPUT, __LINE__); } - asoc->overall_error_count = 0; sctp_stop_all_cookie_timers(stcb); /* process according to association state */ if (SCTP_GET_STATE(stcb) == SCTP_STATE_COOKIE_ECHOED) { @@ -2777,6 +2778,12 @@ sctp_handle_cookie_ack(struct sctp_cookie_ack_chunk *cp SCTP_UNUSED, sctp_calculate_rto(stcb, asoc, net, &asoc->time_entered, SCTP_RTT_FROM_NON_DATA); } + /* + * Since we did not send a HB make sure we don't double + * things. + */ + asoc->overall_error_count = 0; + net->hb_responded = 1; (void)SCTP_GETTIME_TIMEVAL(&asoc->time_entered); sctp_ulp_notify(SCTP_NOTIFY_ASSOC_UP, stcb, 0, NULL, SCTP_SO_NOT_LOCKED); if ((stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || @@ -2786,11 +2793,6 @@ sctp_handle_cookie_ack(struct sctp_cookie_ack_chunk *cp SCTP_UNUSED, soisconnected(stcb->sctp_socket); } } - /* - * since we did not send a HB make sure we don't double - * things - */ - net->hb_responded = 1; if (stcb->asoc.state & SCTP_STATE_CLOSED_SOCKET) { /*