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 1D79D1B87D9; Mon, 23 Jun 2025 21:58:25 +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=1750715905; cv=none; b=U5UlPlOP01kQasa05gRZSOVoN0LFOLrkqH92yBivOy2gBrenDHU6XiJkRI7emm/1/nf9IgcoCy/B9hhOkCKFSaOaES/Rn9NHVQ4cdXN7aBIRBft/qRu1axV8It6AlcldjB3SrXuxJaE2Oaf5jv8LgMkZOALfho7fgrQMWBpPZWg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750715905; c=relaxed/simple; bh=+HRtdODQ6kP6L1eGMD4WhsZuW0x2EjpZnBqWItijsdU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=pa8T/gzKAe3iE6YWbICDH/HeurXPJJUHt11KhSyBcwFKEgmuHh4UVmWxHRSFau6ligsnoazseWWMyykzOhsNPHk5fdOcIaNlCrKdReoG5dpIgWRUOTDzrj+VyKE/n/9TZ3+uzdJI80vjFGwSWOsvdW7o8j/M7ItZ5xwjEKKYM+k= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=DhhsnnNw; 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="DhhsnnNw" Received: by smtp.kernel.org (Postfix) with ESMTPSA id AA3BFC4CEEA; Mon, 23 Jun 2025 21:58:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1750715905; bh=+HRtdODQ6kP6L1eGMD4WhsZuW0x2EjpZnBqWItijsdU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DhhsnnNw6q1OK/dnQnTxfBubJjvy/qqPFkUhfvSPlykY+ACXY8fBsHTV4uj7Q6+a9 F21lQBEQjw1S0Yp6hp18cwS/ra1QnA2U8nZPt78LBUdcsO668zViTH0KZ0LKyLmNDv NE1yPCj1VPdMScf+YZbD++WXyuyZxoKEj0qYjCTQ= 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 6.12 236/414] wifi: mac80211: do not offer a mesh path if forwarding is disabled Date: Mon, 23 Jun 2025 15:06:13 +0200 Message-ID: <20250623130647.940164633@linuxfoundation.org> X-Mailer: git-send-email 2.50.0 In-Reply-To: <20250623130642.015559452@linuxfoundation.org> References: <20250623130642.015559452@linuxfoundation.org> User-Agent: quilt/0.68 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.12-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 2922a9fec950d..ba8aeb47bffd7 100644 --- a/net/mac80211/mesh_hwmp.c +++ b/net/mac80211/mesh_hwmp.c @@ -636,7 +636,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) { @@ -654,6 +654,8 @@ static void hwmp_preq_frame_process(struct ieee80211_sub_if_data *sdata, } } rcu_read_unlock(); + } else { + forward = false; } if (reply) { @@ -671,7 +673,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