From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 23E9942056; Mon, 23 Jun 2025 21:48:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750715282; cv=none; b=GgG65MpXzrhGXH/1HmDNy6UwwcAdVPreX8BP5o04Ov3HQgtNsMK0L6hL9wyYBGw9fema2YDedQdfHiOFxrn1eO6M74dGD7LSpdmlwKj1oijWZtNGOZnWspp0nLnZfW2SFaSMmQj3slhnO1iRaE1Q6RgrR24iRpaPPRCzNs4PiBY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750715282; c=relaxed/simple; bh=TH2gjuRo/kO0c0ngg+s96gwf14rHrP3JSSMHrJUyabE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=OsK6yFarTeyVwz+UPq4hdNZoWw+x+uBIxJtQVPjiZ5B8LEopxmWSUbV+mpdl+BzSvGK9zM7QU+XQKP1n9ZHEdjNvQWlTZuV2JhPXDIh+kDuZF/UzD0PoKupY2w7FaeC2By5Zzn65XItfuwRhfcu70ceA/+KrLrhR6VsbX+fEJ9Y= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=hKTdcV0R; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="hKTdcV0R" Received: by smtp.kernel.org (Postfix) with ESMTPSA id AC904C4CEEA; Mon, 23 Jun 2025 21:48:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1750715282; bh=TH2gjuRo/kO0c0ngg+s96gwf14rHrP3JSSMHrJUyabE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hKTdcV0RpFMc9Bf7/xMEUZdFfUzXANbuZuFbQvLiQJbN6H76x9M9ZfirdzYjekQU6 0yWc2ts+wYUajJvuewIKDCOFIksHYlf8p+K9eH2RoNHtZZShcdw2C8/d7Z3wV/8N4B +/3jsyPkpBN3QEtKwgy0RpcSunZUi3sa4x12F60E= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Benjamin Berg , Rouven Czerwinski , Johannes Berg , Sasha Levin Subject: [PATCH 5.10 265/355] wifi: mac80211: do not offer a mesh path if forwarding is disabled Date: Mon, 23 Jun 2025 15:07:46 +0200 Message-ID: <20250623130634.721673773@linuxfoundation.org> X-Mailer: git-send-email 2.50.0 In-Reply-To: <20250623130626.716971725@linuxfoundation.org> References: <20250623130626.716971725@linuxfoundation.org> User-Agent: quilt/0.68 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 5.10-stable review patch. If anyone has any objections, please let me know. ------------------ From: Benjamin Berg [ Upstream commit cf1b684a06170d253b47d6a5287821de976435bd ] When processing a PREQ the code would always check whether we have a mesh path locally and reply accordingly. However, when forwarding is disabled then we should not reply with this information as we will not forward data packets down that path. Move the check for dot11MeshForwarding up in the function and skip the mesh path lookup in that case. In the else block, set forward to false so that the rest of the function becomes a no-op and the dot11MeshForwarding check does not need to be duplicated. This explains an effect observed in the Freifunk community where mesh forwarding is disabled. In that case a mesh with three STAs and only bad links in between them, individual STAs would occionally have indirect mpath entries. This should not have happened. Signed-off-by: Benjamin Berg Reviewed-by: Rouven Czerwinski Link: https://patch.msgid.link/20250430191042.3287004-1-benjamin@sipsolutions.net Signed-off-by: Johannes Berg Signed-off-by: Sasha Levin --- net/mac80211/mesh_hwmp.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/net/mac80211/mesh_hwmp.c b/net/mac80211/mesh_hwmp.c index 4848e3c2f0af9..a8e80cb6a5cec 100644 --- a/net/mac80211/mesh_hwmp.c +++ b/net/mac80211/mesh_hwmp.c @@ -620,7 +620,7 @@ static void hwmp_preq_frame_process(struct ieee80211_sub_if_data *sdata, mesh_path_add_gate(mpath); } rcu_read_unlock(); - } else { + } else if (ifmsh->mshcfg.dot11MeshForwarding) { rcu_read_lock(); mpath = mesh_path_lookup(sdata, target_addr); if (mpath) { @@ -638,6 +638,8 @@ static void hwmp_preq_frame_process(struct ieee80211_sub_if_data *sdata, } } rcu_read_unlock(); + } else { + forward = false; } if (reply) { @@ -655,7 +657,7 @@ static void hwmp_preq_frame_process(struct ieee80211_sub_if_data *sdata, } } - if (forward && ifmsh->mshcfg.dot11MeshForwarding) { + if (forward) { u32 preq_id; u8 hopcount; -- 2.39.5