From nobody Thu Oct 31 17:00:40 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 4XfVcS1kmqz5c2Rs; Thu, 31 Oct 2024 17:00:40 +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 4XfVcS1Czcz4mMl; Thu, 31 Oct 2024 17:00:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730394040; 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=HL8DhytjhTZ6N1QkBSSn+1fujlOq5jOa9fzcuf6Y5Nk=; b=vOejkmpnHExnRNCi0KRGRrmLUhL9zsNCh0iofqs47pih+dx70WWHrv9VGF04QoQIReelbf IVE5ckDMWm8VEFXSJNVoFnD2ulClNQFvA0hFaznUcOJnBu8bsC93okFPFfFBcoYXgAfyB8 bi2PlALRgMp8FY/YGz9bCgVYTy2NAoqrH/MtsL/LGRJLBaNJC95Uc6Maw2Vt2rwzVq0SDd eKLGz7clSwIzoHm/l9+mPrUXv3BfOTeo+FqrYbCiAbwr3T1m96CdjErvG8gVSgmW+wC5YP tNPorAjJFtYrKu+iLSWFP5FjagKLbbcJCVKACiaB+Vr47Al/5T9FHV8zlgLRGw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730394040; 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=HL8DhytjhTZ6N1QkBSSn+1fujlOq5jOa9fzcuf6Y5Nk=; b=bSt5J9Hy0dUf+Mywo0yAMEscKjSzf5UE59of1S8yQt5rWzFec/OdVEPgfQWzkaEdOL3TOg z7x6MZhz0aRIi2jJxSW45eLYiUKfs1+HS+SA7qeY8+jxKp36Oycf6YzOmsYVFhb29rcMPH 1iZe7xVOTWEOx90CD9OQVnBRjbnKoWCfmKibJQ7W16Zatvc1NYC9xE1Qs49I+TTHd8XvA9 sXOpq+ZxKvSMOyGVlDAHn6DRTwIsAg/7XH8KVRKMSM6/r0hvWCzIolX6b+bFxA5q7xSEs/ Kqi0qjrRnUjydASv2aPunje1WeLZ2+DYgqeNk0J4U2EW0VwUK6/TYL/fBTCAhA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730394040; a=rsa-sha256; cv=none; b=TdVrOPTPFKoP0fVImWuYeTcFFiNytDwwYvWguRIhXTZ1BDXU7SXKybUCpMrioKq2nZ9K3p hbIzxFVfHJhFZcstDLdhH2nmssRu5Kzcw4a0WpEL1FpOkfUa2glpA6TycEkC/sH0TuDzAt laMvaa/+LiWyrAE8KJK17CeYlLdf807RkdpvKHWlWGwlwCKtrwLydCHshpBRN6exo/JDXR /DanoXIlDtE2+g+qIeTnYC0Icqhzg8aYDXn2nhxxAwRmOch7Qn9v9APJP5d6pX7qlxXnGr 7w/EhrNi9JjkPuH5f6Ki1QbaoUE3LEkze5bA12gYxO+g0e8/kTn1n9bU/C3o6Q== 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 4XfVcS0jv2zkbM; Thu, 31 Oct 2024 17:00:40 +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 49VH0eBZ082666; Thu, 31 Oct 2024 17:00:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49VH0eXl082663; Thu, 31 Oct 2024 17:00:40 GMT (envelope-from git) Date: Thu, 31 Oct 2024 17:00:40 GMT Message-Id: <202410311700.49VH0eXl082663@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: 258e38014cad - stable/13 - 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/13 X-Git-Reftype: branch X-Git-Commit: 258e38014cadada0c1a7d48185935369167d8527 Auto-Submitted: auto-generated The branch stable/13 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=258e38014cadada0c1a7d48185935369167d8527 commit 258e38014cadada0c1a7d48185935369167d8527 Author: Michael Tuexen AuthorDate: 2024-10-10 08:36:00 +0000 Commit: Michael Tuexen CommitDate: 2024-10-31 17:00:16 +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 f3b51b796df0..489da8b1a5ed 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 */