From nobody Wed Mar 15 21:57:34 2023 X-Original-To: dev-commits-src-main@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 4PcPQ64Gf0z3xr2S; Wed, 15 Mar 2023 21:57:34 +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 4PcPQ63crlz44NG; Wed, 15 Mar 2023 21:57:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678917454; 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=pABz+mJaD5RLWFFsAGSc2ga17Oy/PtL5dVG6wc3A7AU=; b=HTWmY6e87+odPqjHvRoN52pHWCurXmQaWbbZt825tIYQ+leYFPaXdTbchhqQZqyYJ2besH LNj3hY7iFfQaOM1vSZCannnuZhaDivBy7HrXaOTtkFYd6S4q1LAcNzdpEqJGYBtbKDYzC0 6lEHlqJ2J5gQnn3jx2NrhDAhJD1UmeoljADoinNgtTEI/Ms2JyirRh97s47s3+2rO798sk EgOOG1FRrvLz/xKDqAOekEi9MJBY6j3zwsXy0rG2V2YiLijN5shQJCi5JRlU7DyAb9SvF/ 11jjdsmAHlpyJE4Ang7T/cUDwx2tzth969qc+v0j4Ke5XvhunjLrrfVBFmZdVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678917454; 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=pABz+mJaD5RLWFFsAGSc2ga17Oy/PtL5dVG6wc3A7AU=; b=E+0TTDljtiWPvOzONqrH4G7kIhkSRv9B7QNMCSmAS8zDKOzZXcMqSpRr42by/WLk2d8h7i eKwvlZDreZwwzVrcOJdG0hR0DgbygB6bEtKwBmkq8gpHHI9WPfnpSrouDst+W6WEcxb6C6 nJlZlVVNciuK4EE2FFeuVzzyGWhnQz2wxqoeT3p5GnXX3N1dF70yi4WZQgc2TPxkIZYQgb u5/j0dsUV7MzjYTfwcfYZoOLuA8vQgNAzWYM3nuaC2gOP57TbmTuA+0d6kEBndYOvz1zAf 2otavq8Kl+ZrxgcegI/SGF4L40rUWagwjcVBQuanuUXrX0UN2UchRML7W+8mYQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678917454; a=rsa-sha256; cv=none; b=He+A9rDD2cSQReMRIFua9xLj4irbYjTS+ZSKr3dGikIDwd/mr0fjiq6EY0DREROS7QfNhb FAPxYnOSbzygyTQujG/Sy+C7f0fxnA1avupmC4Y2j06GJqPBvni39ACmFlh7oYuL+6znzB unrkrC25FYzxhilgIhv8IW46D9Lfu0mjHzE3ztZnYcedYGZU1FPSuEjDT5R/pMhJrm66Rw UOWUN3Gek3yZ8NLjOD920njdIMPlVYTEZeAF5YsnjNPTKUa1uIrlzXbDzq2c2WQNe4toBD SIrW04uzy3l/WcQcU9pNkMbyjpClrk3Ee5wwnXogjm8oP3/E53V0wvWCQXlp2w== 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 4PcPQ62gNVzJ83; Wed, 15 Mar 2023 21:57:34 +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 32FLvYTC067615; Wed, 15 Mar 2023 21:57:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32FLvYLL067614; Wed, 15 Mar 2023 21:57:34 GMT (envelope-from git) Date: Wed, 15 Mar 2023 21:57:34 GMT Message-Id: <202303152157.32FLvYLL067614@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: cee09bda03c8 - main - sctp: allow disabling of SCTP_ACCEPT_ZERO_CHECKSUM socket option List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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: cee09bda03c8be540f1c02d933db714ee2bd6ec7 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=cee09bda03c8be540f1c02d933db714ee2bd6ec7 commit cee09bda03c8be540f1c02d933db714ee2bd6ec7 Author: Michael Tuexen AuthorDate: 2023-03-15 21:55:23 +0000 Commit: Michael Tuexen CommitDate: 2023-03-15 21:55:23 +0000 sctp: allow disabling of SCTP_ACCEPT_ZERO_CHECKSUM socket option --- sys/netinet/sctp_usrreq.c | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/sys/netinet/sctp_usrreq.c b/sys/netinet/sctp_usrreq.c index 57d5abdebd30..65edfb49a955 100644 --- a/sys/netinet/sctp_usrreq.c +++ b/sys/netinet/sctp_usrreq.c @@ -6840,18 +6840,10 @@ sctp_setopt(struct socket *so, int optname, void *optval, size_t optsize, SCTP_CHECK_AND_CAST(value, optval, uint32_t, optsize); SCTP_INP_WLOCK(inp); - if (*value == 0) { - /* - * Do not allow turning zero checksum - * acceptance off again, since this could - * result in inconsistent behaviour for - * listeners. - */ - if (inp->zero_checksum > 0) { - error = EINVAL; - } - } else { + if (*value != 0) { inp->zero_checksum = 1; + } else { + inp->zero_checksum = 0; } SCTP_INP_WUNLOCK(inp); break;