From nobody Thu Oct 31 14:00:06 2024 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 4XfQc649Ymz5blX0; Thu, 31 Oct 2024 14:00:06 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XfQc61Y1Wz41Db; Thu, 31 Oct 2024 14:00:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730383206; 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=T7Ude7hwCotXvUhTCihw7H64hyZQktBSlICJd+RSmnE=; b=kwqEVl7AS9jObCMjjUesSgR/mz2yohgwsyEyeuDqoGHkI5C18LU2atyqeRkZaJhbOkeyuu f7ApSIHGXfiDTpsKm8BWyJnYCRWbAKYcIvdbmUhV2MXALDOta+bsS22S6nJb5CcZ2MW4pd hy5BEHjoK8MbbJyVum9vGE6aoYJ0BxMjm8kzoAWG4Y6GP+hN1zwXQNvzT1+oFCADQ+Y5gN PvYlvgRiQCPEGRpmDz7X1ruh/GaKX+9V2+Fu4vYPVgVhWtJCBxh0oohq2TxdRyQHsu3R4J WxUCiBw4i+nIVcKnBsiTXkH4SePWkTB+hDKthqiU9VuRNiKWovkRhx1yNNCu4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730383206; 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=T7Ude7hwCotXvUhTCihw7H64hyZQktBSlICJd+RSmnE=; b=Slh6V1C4MsS0NzP2ssw/krCrbCW/AWZyz/VG64fSeoWUk3TscbPeqB+sJxySLa3jIGsEvl 1Ty5C3ZX+2BN4pJpkuXsXFaXpF9N+MHVrdkk0oG7eUk0EZ5sdoRbjo/uhR7v2WnhzBNZxc E1dufx7Qg5ynn7bsLNqO9x3W3nzRzA2PJ6Cjo6qPGVVXB3p39WQMoS30sJ4NI8Za/cIx5T LyPfBe55SU+yHdAwwU3hcMVqHyREwt7YZTudCDMuczbpM1mnF3wSW9ETXxPrylx0HIXyxw Pw30S8WSaJTEo2uQrafcVOR7eBcpfxVCSf/187CNCKkMWAd9BA1iTNWvqsqYbw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730383206; a=rsa-sha256; cv=none; b=eaWhDPN/H5+kv2p/vX3TnOh4HmuXgcOz6b3SsTCF8dPfxXhW4hDrSOhoqpDHQZAlab8X6D 7KX1kl9ellO6u+G7RiZD+w9/9n/wYMdKoRRt9URYUTm1/uyB5pozKNftCIBGfvNsrH584v Trzp+r3lPazHhMQ1uPAonCtIoAAWjrqbxX7NjnqF6b34Jbg7xzb7N8RQ9584bRl0Le/jhc W6IfaVHHf1eifoRkOIbFgfu2CQrfoc0Z+mN0yFRJybU/34X6jJggT8obDD9Z9wdDwUtMSO vlR2DaRrBXEI/dKwILmORKk3db5yg+O8eYOwMn2uLCwzj4GFyHRf7XoSMlFI0A== 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 4XfQc6193Yzdh4; Thu, 31 Oct 2024 14:00:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49VE062N034549; Thu, 31 Oct 2024 14:00:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49VE06xt034544; Thu, 31 Oct 2024 14:00:06 GMT (envelope-from git) Date: Thu, 31 Oct 2024 14:00:06 GMT Message-Id: <202410311400.49VE06xt034544@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: efcaa63aca0c - stable/14 - sctp: cleanup sctp_delete_ifn 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-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/stable/14 X-Git-Reftype: branch X-Git-Commit: efcaa63aca0c7b1c0baacd333725f137e3fea678 Auto-Submitted: auto-generated The branch stable/14 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=efcaa63aca0c7b1c0baacd333725f137e3fea678 commit efcaa63aca0c7b1c0baacd333725f137e3fea678 Author: Michael Tuexen AuthorDate: 2024-10-10 08:36:00 +0000 Commit: Michael Tuexen CommitDate: 2024-10-31 11:38:39 +0000 sctp: cleanup sctp_delete_ifn The address lock is always held, so no need for the second parameter. No functional change intended. (cherry picked from commit 2e9761eb80f3e58c116efc10c739ed0d8497c1d6) --- sys/netinet/sctp_pcb.c | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/sys/netinet/sctp_pcb.c b/sys/netinet/sctp_pcb.c index b2cafdc2f81e..2972b0a925d6 100644 --- a/sys/netinet/sctp_pcb.c +++ b/sys/netinet/sctp_pcb.c @@ -277,25 +277,16 @@ sctp_free_ifa(struct sctp_ifa *sctp_ifap) } static void -sctp_delete_ifn(struct sctp_ifn *sctp_ifnp, int hold_addr_lock) +sctp_delete_ifn(struct sctp_ifn *sctp_ifnp) { - struct sctp_ifn *found; - found = sctp_find_ifn(sctp_ifnp->ifn_p, sctp_ifnp->ifn_index); - if (found == NULL) { + SCTP_IPI_ADDR_WLOCK_ASSERT(); + if (sctp_find_ifn(sctp_ifnp->ifn_p, sctp_ifnp->ifn_index) == NULL) { /* Not in the list.. sorry */ return; } - if (hold_addr_lock == 0) { - SCTP_IPI_ADDR_WLOCK(); - } else { - SCTP_IPI_ADDR_WLOCK_ASSERT(); - } LIST_REMOVE(sctp_ifnp, next_bucket); LIST_REMOVE(sctp_ifnp, next_ifn); - if (hold_addr_lock == 0) { - SCTP_IPI_ADDR_WUNLOCK(); - } /* Take away the reference, and possibly free it */ sctp_free_ifn(sctp_ifnp); } @@ -450,7 +441,7 @@ sctp_remove_ifa_from_ifn(struct sctp_ifa *sctp_ifap) if (LIST_EMPTY(&sctp_ifap->ifn_p->ifalist)) { /* remove the ifn, possibly freeing it */ - sctp_delete_ifn(sctp_ifap->ifn_p, SCTP_ADDR_LOCKED); + sctp_delete_ifn(sctp_ifap->ifn_p); } else { /* re-register address family type, if needed */ if ((sctp_ifap->ifn_p->num_v6 == 0) && @@ -555,7 +546,7 @@ sctp_add_addr_to_vrf(uint32_t vrf_id, void *ifn, uint32_t ifn_index, (void *)sctp_ifap); if (new_ifn_af) { /* Remove the created one that we don't want */ - sctp_delete_ifn(sctp_ifnp, SCTP_ADDR_LOCKED); + sctp_delete_ifn(sctp_ifnp); } if (sctp_ifap->localifa_flags & SCTP_BEING_DELETED) { /* easy to solve, just switch back to active */