From nobody Thu Nov 07 09:47:18 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 4XkcgB5JvNz5cdMQ; Thu, 07 Nov 2024 09:47:18 +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 4XkcgB4Yr1z4HYc; Thu, 7 Nov 2024 09:47:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730972838; 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=6Exen8PFiR/N/pwzHERJOG20ZwtRVR7v5hE/gB88SHU=; b=BztM/GOTqWPtvlXNURQvnX8uskRAht49NlMp5vR99n6U58KDYLCNliIV6scV7w/jcAOc65 izNhCldVYyF7PX4ELR8JUuPBB1jhbDI61zmVcQrGyYePZU5EHMR3LYjaLA6oVLt8nqyosj aM9bP+VfWjtaVWCYFc57fo9xNbiZrA2t/EELxLJVTnXVGlxFNBLmKBsl4l4eoJg9M1B6jy /tQfJg0Hd9XRkbWBtWMSgxRyV52FqXjjSv/MR+Sa4bihyDg/pq0AE6hjoW7Ym0Aric2whP prEofValJ23iwoXXTqianJm+WbewT3M19FBlCKDcc3i/cxJPnTkiJRZejChYnA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730972838; 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=6Exen8PFiR/N/pwzHERJOG20ZwtRVR7v5hE/gB88SHU=; b=jqkZe8fup4PzhgE+EpJ9cPoP2zDnD6eugbNUuOl0mmBq0TyeGlY0XQANiaXJMPJdL7xH12 RHQBSGBPKWf2BpSNGQoTAENb4AmX2sVE/YbBlKhPvndY23sLI4Ji+rlaKhhKuPqOca5i+e OtYhje9qEVClRJ6fkI1SPysXSJUJkuMW8o1wrW/UzCoLQB+5V+0+Tl8O8Z+Ghe3uazoZao DY4NTQYscn0/ihpyy2kk2fNIHcv/vlTASPpzaSJaJJrP7Fr8ENpo3vLgPuLXkjdmR/IJHF sjg8g3r3kZJDVaX0/tdRM9N0OZ/DsmmVMwNx1zZIXEv5LE1cGC7V3yiOCkh9qw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730972838; a=rsa-sha256; cv=none; b=O7L5xE7ZXrufgSv6XGsq7eLj5dsrMHVYJSabxvxiJ8J90si1gtGayfJg4/Hha9CJFgUdGX baPu7ge0Nyhj7sdYILH108ySKe03zSlJKmWiwbX5iGOYDBqgARwaucU31iF1W/U5LiXww4 VSf0TACqpttyZc4uuwKP8vTvJtAoCaaH/H1IgPD3FhILWpRulRx8T6E0Zheqypg+F0fHVK I8O0o4b4dotCqQcPR2pF+Ml9tAAFAT/gha4WXN27/rYQvQWSBhvsFNKJtnKVE8mJoU0hx4 azIKoKD8tGPhixthp+2bBEMtbbW45uF2SxmonygsfnEMvfsFN2kOgUrIddigdQ== 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 4XkcgB49J9zgSJ; Thu, 7 Nov 2024 09:47:18 +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 4A79lICp010134; Thu, 7 Nov 2024 09:47:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A79lIAj010128; Thu, 7 Nov 2024 09:47:18 GMT (envelope-from git) Date: Thu, 7 Nov 2024 09:47:18 GMT Message-Id: <202411070947.4A79lIAj010128@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: bb6af83fe47b - releng/14.2 - sctp: don't consider the interface name when removing an address 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/releng/14.2 X-Git-Reftype: branch X-Git-Commit: bb6af83fe47b88a60926bda73e87e4d40dfe19a9 Auto-Submitted: auto-generated The branch releng/14.2 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=bb6af83fe47b88a60926bda73e87e4d40dfe19a9 commit bb6af83fe47b88a60926bda73e87e4d40dfe19a9 Author: Michael Tuexen AuthorDate: 2024-11-02 15:33:02 +0000 Commit: Michael Tuexen CommitDate: 2024-11-07 00:02:12 +0000 sctp: don't consider the interface name when removing an address Checking the interface name can not be done consistently, so don't do it. (cherry picked from commit bf11fdaf0d095fecca61fa8b457d06e27fae5946) (cherry picked from commit 66628552a38751ed5c395858d1754660557674cd) Approved by: re (cperviva) --- sys/netinet/sctp_bsd_addr.c | 3 +-- sys/netinet/sctp_pcb.c | 27 +++------------------------ sys/netinet/sctp_pcb.h | 2 +- 3 files changed, 5 insertions(+), 27 deletions(-) diff --git a/sys/netinet/sctp_bsd_addr.c b/sys/netinet/sctp_bsd_addr.c index a91b0dde5967..3c6952ab6f3c 100644 --- a/sys/netinet/sctp_bsd_addr.c +++ b/sys/netinet/sctp_bsd_addr.c @@ -338,8 +338,7 @@ sctp_addr_change(struct ifaddr *ifa, int cmd) (void *)ifa, ifa->ifa_addr, ifa_flags, 1); } else { sctp_del_addr_from_vrf(SCTP_DEFAULT_VRFID, ifa->ifa_addr, - ifa->ifa_ifp->if_index, - ifa->ifa_ifp->if_xname); + ifa->ifa_ifp->if_index); /* * We don't bump refcount here so when it completes the diff --git a/sys/netinet/sctp_pcb.c b/sys/netinet/sctp_pcb.c index b7b531ab33ab..cd5479c11e6a 100644 --- a/sys/netinet/sctp_pcb.c +++ b/sys/netinet/sctp_pcb.c @@ -662,8 +662,7 @@ sctp_add_addr_to_vrf(uint32_t vrf_id, void *ifn, uint32_t ifn_index, */ SCTPDBG(SCTP_DEBUG_PCB4, "Lost an address change?\n"); /* Opps, must decrement the count */ - sctp_del_addr_from_vrf(vrf_id, addr, ifn_index, - if_name); + sctp_del_addr_from_vrf(vrf_id, addr, ifn_index); return (NULL); } SCTP_INCR_LADDR_COUNT(); @@ -688,7 +687,7 @@ sctp_add_addr_to_vrf(uint32_t vrf_id, void *ifn, uint32_t ifn_index, void sctp_del_addr_from_vrf(uint32_t vrf_id, struct sockaddr *addr, - uint32_t ifn_index, const char *if_name) + uint32_t ifn_index) { struct sctp_vrf *vrf; struct sctp_ifa *sctp_ifap; @@ -709,27 +708,7 @@ sctp_del_addr_from_vrf(uint32_t vrf_id, struct sockaddr *addr, if (sctp_ifap != NULL) { /* Validate the delete */ if (sctp_ifap->ifn_p) { - bool valid = false; - - /*- - * The name has priority over the ifn_index - * if its given. - */ - if (if_name) { - if (strncmp(if_name, sctp_ifap->ifn_p->ifn_name, SCTP_IFNAMSIZ) == 0) { - /* They match its a correct delete */ - valid = true; - } - } - if (!valid) { - /* last ditch check ifn_index */ - if (ifn_index == sctp_ifap->ifn_p->ifn_index) { - valid = true; - } - } - if (!valid) { - SCTPDBG(SCTP_DEBUG_PCB4, "ifn:%d ifname:%s does not match addresses\n", - ifn_index, ((if_name == NULL) ? "NULL" : if_name)); + if (ifn_index != sctp_ifap->ifn_p->ifn_index) { SCTPDBG(SCTP_DEBUG_PCB4, "ifn:%d ifname:%s - ignoring delete\n", sctp_ifap->ifn_p->ifn_index, sctp_ifap->ifn_p->ifn_name); SCTP_IPI_ADDR_WUNLOCK(); diff --git a/sys/netinet/sctp_pcb.h b/sys/netinet/sctp_pcb.h index 86c244c71544..1249c2233c63 100644 --- a/sys/netinet/sctp_pcb.h +++ b/sys/netinet/sctp_pcb.h @@ -510,7 +510,7 @@ void sctp_free_ifa(struct sctp_ifa *sctp_ifap); void sctp_del_addr_from_vrf(uint32_t vrfid, struct sockaddr *addr, - uint32_t ifn_index, const char *if_name); + uint32_t ifn_index); struct sctp_nets *sctp_findnet(struct sctp_tcb *, struct sockaddr *);