From nobody Thu Oct 10 08:37:26 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 4XPNRV6xvMz5Yfpj; Thu, 10 Oct 2024 08:37:26 +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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XPNRV6HHfz4jQG; Thu, 10 Oct 2024 08:37:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728549446; 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=zwcVtXTg4o2art004Hr14XQ+ThOOJyxWxjaq4WYRcnc=; b=JLnEIL8ZIsDes9y7hc/wyh2qo0zWG10VndSZ0KePCWoee2TVUAb5Z2Tqg0bmRZbb2WdS08 mlwvQ4KUYZ1GFxAhObT85NZywaPxGgK+CERt+zhybQLhTQEYgvE324JDyMCGHXcTYZdOBr 0xSXHdDGtDRDDMiLZfxU5ayndrM8BD9sJPGZQHkS46/h9FZ+ZWZ79ycbteWebS2Ho+iNac 4MJLKbWRK/WFGnc7DJ3tZkpOTxroiD+hpFghesMU/cUbaOJcFt6sRpBIIXjUI17NCzwDCl xk6/+TrMwSiyT0LAeIghB3964EtLCT/ieD0sNK8ZYvtmXzJY3PBUpdfFqK5KIg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728549446; 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=zwcVtXTg4o2art004Hr14XQ+ThOOJyxWxjaq4WYRcnc=; b=htkkDcJbD78StFla+oQdu0VUOM+9JfXL69VjvdfwMa7l6cY1AN45naf/Omnw6gH0/LdQ1O zUUI4BfzHdVJp8jYF5xLyL+VhAl6SF5dFuu2Eqwl1F0yfwGlT985ak1MCTxVVDzcI5+Sty bkk8jKQiKOLtpptlJ8XbEEa4MSPxgl0tpZ7lmp3B/CF6PuHUqN65xXsOkAmpY/SiLNOLGn 84nP8nf7WRtdDjrg+xuiJcDdimDPxMa3XlUMtm9+kDFLFwkkvgArd16PCYDEwNMsHBC1F4 n/y4cCrhz4nK2xdvJntRGibH0+5DUAeRItfefSJ7kC9rymlij20Z2P8XuQcbpw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1728549446; a=rsa-sha256; cv=none; b=R5mbZD8vzMvV1C1vtBY17mXDLc311JUXfVZY7Y34I1NU1w+ZF1GoDxgoKLI3g4JrXAmc48 MjCVvp8TzQ5/KgrNLXEh8a5egOzKGLMQ5VZzFpeoK4GaZ7SHQRf/2XBd4K8ylcZmc1xKvW 8gkiMA5vV8qqRECm62WzD/WN75ixMkNFP9y/6HaQFqIlaH/NcLRsBNnxq6KWru5sPNcSDh Ml9cfwVqm5YCDayqc/2QESFUigpbiye5AU4i8jPESZo4Io4ZyfQ8qmHGvqVKueDMvje+VZ zsuX1EfCIY1mFK2KHdIVJZ9pLzP7De/sCgXBL9NKNyfvR/2S0hQcaS0p4qg/6Q== 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 4XPNRV5cDczr5F; Thu, 10 Oct 2024 08:37:26 +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 49A8bQ5s098944; Thu, 10 Oct 2024 08:37:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49A8bQBW098941; Thu, 10 Oct 2024 08:37:26 GMT (envelope-from git) Date: Thu, 10 Oct 2024 08:37:26 GMT Message-Id: <202410100837.49A8bQBW098941@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: 2e9761eb80f3 - main - 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/main X-Git-Reftype: branch X-Git-Commit: 2e9761eb80f3e58c116efc10c739ed0d8497c1d6 Auto-Submitted: auto-generated The branch main has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=2e9761eb80f3e58c116efc10c739ed0d8497c1d6 commit 2e9761eb80f3e58c116efc10c739ed0d8497c1d6 Author: Michael Tuexen AuthorDate: 2024-10-10 08:36:00 +0000 Commit: Michael Tuexen CommitDate: 2024-10-10 08:36:00 +0000 sctp: cleanup sctp_delete_ifn The address lock is always held, so no need for the second parameter. No functional change intended. MFC after: 3 days --- 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 340786e3484e..1c634933ed6e 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 */