From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 528FAC10F04 for ; Fri, 15 Feb 2019 02:26:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0E1402073D for ; Fri, 15 Feb 2019 02:26:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1550197602; bh=Krqw4jgFcBk1a/kuUBeO/F+Z41WcTFca1GLmgkab72s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=oT8/s2OdYmoTIpsFgYQElogsKiO11nwdz5ygWNi72tSBy31zGvOe6IDZ3zN+B9beG BCpp96zE28BkGAvjjZ3oVtfRyi7kgRIpc2Vys+p/CpOVhu+bWgkNlDYqBuLbPXEXZM 5Ioa8w3OvgtwtPgqec0H8DL+EM7wifKX0C2YgWCg= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2404902AbfBOCNt (ORCPT ); Thu, 14 Feb 2019 21:13:49 -0500 Received: from mail.kernel.org ([198.145.29.99]:53740 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2404854AbfBOCNs (ORCPT ); Thu, 14 Feb 2019 21:13:48 -0500 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 6ADAF222D0; Fri, 15 Feb 2019 02:13:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1550196827; bh=Krqw4jgFcBk1a/kuUBeO/F+Z41WcTFca1GLmgkab72s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UEx9nnuAj5r9403zxeWuTIvDVk0wbsYw0jbxIUGPNljfoTEfcN3oCKxQ8DBzZk5Tk ProhdRuLvc9yed/aH1+fMxR5dAeDmSnJn3Pfk8YoWHE8nzgps1A5X9zfdzfdQaIkq6 +Z7ZqJTtuMyaGAJ/WdZhIqq2EDe0zu41c+eWnuh4= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Bob Copeland , Bob Copeland , Johannes Berg , Sasha Levin , linux-wireless@vger.kernel.org, netdev@vger.kernel.org Subject: [PATCH AUTOSEL 4.14 18/40] mac80211: fix miscounting of ttl-dropped frames Date: Thu, 14 Feb 2019 21:12:51 -0500 Message-Id: <20190215021313.178476-18-sashal@kernel.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190215021313.178476-1-sashal@kernel.org> References: <20190215021313.178476-1-sashal@kernel.org> MIME-Version: 1.0 X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Bob Copeland [ Upstream commit a0dc02039a2ee54fb4ae400e0b755ed30e73e58c ] In ieee80211_rx_h_mesh_fwding, we increment the 'dropped_frames_ttl' counter when we decrement the ttl to zero. For unicast frames destined for other hosts, we stop processing the frame at that point. For multicast frames, we do not rebroadcast it in this case, but we do pass the frame up the stack to process it on this STA. That doesn't match the usual definition of "dropped," so don't count those as such. With this change, something like `ping6 -i0.2 ff02::1%mesh0` from a peer in a ttl=1 network no longer increments the counter rapidly. Signed-off-by: Bob Copeland Signed-off-by: Johannes Berg Signed-off-by: Sasha Levin --- net/mac80211/rx.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c index 9e19ddbcb06e..7e9725d47557 100644 --- a/net/mac80211/rx.c +++ b/net/mac80211/rx.c @@ -2532,7 +2532,9 @@ ieee80211_rx_h_mesh_fwding(struct ieee80211_rx_data *rx) skb_set_queue_mapping(skb, q); if (!--mesh_hdr->ttl) { - IEEE80211_IFSTA_MESH_CTR_INC(ifmsh, dropped_frames_ttl); + if (!is_multicast_ether_addr(hdr->addr1)) + IEEE80211_IFSTA_MESH_CTR_INC(ifmsh, + dropped_frames_ttl); goto out; } -- 2.19.1