From nobody Sat Nov 02 16:34:20 2024 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 4Xgjx90Fxrz5cJtY; Sat, 02 Nov 2024 16:34:21 +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 4Xgjx86pdXz4SJf; Sat, 2 Nov 2024 16:34:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730565261; 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=Q8YiEGGoJM3mqvQAxUWADexf4GV/woQO6u1mH195d84=; b=sYic1+5Fe/UPaImnebB6DG6Y26jfwMe1c+YrmwlrV2s2hmMeNhKu/FiFL0E52nYCcG4ODD KWlVCzjW0Z5UZNiErnclmRM0c0WsQOr7HR3hnoEW4XirW7u0WxAP75hxk+70Y/uDDwgXyx FqPQuZbpJQOjEiGiGfRucIt7kU74RTRHC+FhBgPk3x9/9KiPU1owBpITMROH0LZVxjw0iM 7/SadWM/Hln/D+qBiFbsrca3f79HYZhhpPwEYTBbHZOZiVLVjGUuPpkP8JunS/wTukIoZZ WSavPl+AcJ4a4LcfaBfrUv36XcN7tkp+cYQTfcppCZ4KcauJCbJ93VqrnzQkVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730565261; 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=Q8YiEGGoJM3mqvQAxUWADexf4GV/woQO6u1mH195d84=; b=DrhsylcQCo2h1UEeUb3LI5X2e4wkrh7okg/NBa6ljcSot6PSuKAjNqWC0VRN2dzyYYjqQ/ IBjwcWlFCFeDdXLS+6gz503hUV8/TQzqDg9CcHRRDnAomi/0zyXNEycEMZEnsbpxkbcfrH L74Q0zQuYk5D2RYHZRu4CAS3JhRS/hSJcjp82DJL5vSHd/pz6KPsNG0XKDRPl5IDlsdVA+ 05QTDIG0u8iT46/0MUdGhru/nmqlWUBA6t7/aKUkMApAvQyvZejJ/eScaEyV9P2ojrHLgd rOWEWLWpTzE3Rs8UAPK2WOWkfT+y2Fw6qeAnIO7PARUT1D9DFpMU4iNjdEApcg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730565261; a=rsa-sha256; cv=none; b=MH7ylEgiqDmlTgOWHChQTyQ5V9CPvPkIt3DV9Yq6b/Q5eWyqIXI22dbpHPr3IXpQKyqp3o 3HRUwB5JIqwNQjuDrikY+EU3mdhgGQoV9crthE0l9UfSLgMJfjYYyUSXphMrpOBm8S/+bK xFvB/7fL6kI1Ap5upspfZwQS6dybbkuAlbj7X3ckpQVyqL1tJi9iLiJgXMma94grrHYkGq OXGkC7E4n1h9eRAhmtWLlgOkO/iGacf/K+VuZR6bAoD0+ZNCn5LAtV1hbPKJq6ibLFpPbZ UOH7v1I04c9yGPm5Tg9aE1URWrtLYP1mV7cvpE2gdKgqNdyGRs8gZBC1AXUjPg== 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 4Xgjx86Q0nz1BP0; Sat, 2 Nov 2024 16:34:20 +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 4A2GYKLU097937; Sat, 2 Nov 2024 16:34:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A2GYKGt097934; Sat, 2 Nov 2024 16:34:20 GMT (envelope-from git) Date: Sat, 2 Nov 2024 16:34:20 GMT Message-Id: <202411021634.4A2GYKGt097934@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: bf11fdaf0d09 - main - sctp: don't consider the interface name when removing an address 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: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-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: bf11fdaf0d095fecca61fa8b457d06e27fae5946 Auto-Submitted: auto-generated The branch main has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=bf11fdaf0d095fecca61fa8b457d06e27fae5946 commit bf11fdaf0d095fecca61fa8b457d06e27fae5946 Author: Michael Tuexen AuthorDate: 2024-11-02 15:33:02 +0000 Commit: Michael Tuexen CommitDate: 2024-11-02 15:33:02 +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. MFC after: 3 days --- 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 c37fe2eed88a..6d8757912f3e 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 *);