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.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham 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 0DF49C43381 for ; Mon, 4 Mar 2019 08:33:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D2104208E4 for ; Mon, 4 Mar 2019 08:33:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1551688410; bh=jAbqL8wX8ZCAmWS/Zt4lK4kQHOQ06gELsyykgpRXwuY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=QFCe9CyTuQBMKuOUwiL/VHw0bTys6uMKCFc4V9WkfL0lHmkV7FXbuxh025GB3BRHk bf57C/RqbcgM2GDsss+uTqIOBW0fK2+uNGoqJiW9SWPJRmZduQBjmkaj5jDGSKlNn5 TUqF3o+1llUW6pQsZyuZga7y2PRynkIw86vHOWco= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727861AbfCDId2 (ORCPT ); Mon, 4 Mar 2019 03:33:28 -0500 Received: from mail.kernel.org ([198.145.29.99]:37998 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727153AbfCDIdZ (ORCPT ); Mon, 4 Mar 2019 03:33:25 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 2490720823; Mon, 4 Mar 2019 08:33:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1551688404; bh=jAbqL8wX8ZCAmWS/Zt4lK4kQHOQ06gELsyykgpRXwuY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dH9gEmbHsR4xwPcApAwrQgDfpVRm/YrLOlnjfXdevjPHn1xZsXuf67Wgu7OkLTLfG l8ZiaJeW5N7OMIm0XXpmhrcio5Ze/aMiHVIi0d2KS6DVwAUftWMlA1fNjyXlvA4a23 mFPI0yLg0l9bGkG107Zm4+7bh2AfSZUf5R8fAJkg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Bob Copeland , Johannes Berg , Sasha Levin Subject: [PATCH 4.20 34/88] mac80211: fix miscounting of ttl-dropped frames Date: Mon, 4 Mar 2019 09:22:17 +0100 Message-Id: <20190304081631.941289378@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190304081630.610632175@linuxfoundation.org> References: <20190304081630.610632175@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.20-stable review patch. If anyone has any objections, please let me know. ------------------ [ 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 46ecc417c4210..2ee3f09eced1c 100644 --- a/net/mac80211/rx.c +++ b/net/mac80211/rx.c @@ -2720,7 +2720,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