Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp575892img; Fri, 22 Mar 2019 04:22:29 -0700 (PDT) X-Google-Smtp-Source: APXvYqxMKvY4+wldklbfuSNhODfy81Kds4YZFQ2gKusuKRo67cYj/vERNxbkqEe1JCRSlSrfZRnR X-Received: by 2002:a17:902:14b:: with SMTP id 69mr8969901plb.216.1553253749474; Fri, 22 Mar 2019 04:22:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553253749; cv=none; d=google.com; s=arc-20160816; b=qb3KGgtZxSfaBhjBGoAB7czovi2SrjhjvF0n0YYuILYLoBhK48S0V0SZZZCbjrVVI8 92NPXmwc68B9EkDCHTfIwStwzo5O3yBeLnZuTNllFqWnE/SkAIFsyAE7RzaZyY2GS/Xw LwWG5FOG8Ckf2vZ3eDW+wvGPtAsTHaksOUYeNz9F7U+MSNJRS3LiHZbcd1acrlBFBzwp +iBm9QBDG8tH+T/RHGrCJtv8qdxES8k31I9Hn1wBemJnZN+/SCk84+p2KRb6jZzH9tYL ROOZHpO6IgvfKQGJhexhEaBK4D8b/cw0w5ADGq+Jg/X8bYfkLrCowKknafy3Ly1RTT7J ZdxQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=eM1PvjenDOiTNuwV9TK7REpq7CzdWvOwaHbI5AuROa0=; b=Kq+ZHk9WYuelplP630ES6oHU/qCH59HgWyDf795x/Ed8iMevHbnWq6HTjtleqYW5Z4 Y71AfFn968nrkeXN7QqjZmvTmRYnLlmvwpqyTk2KRLREQnN1ueyiUXbKHSFeRnthHYPQ A0nvrmmT4QMSvAqowSdY4hvGRmZg09Cu+nsu7Ej7jeHC/3tDnfp79xRCGHHPQxO1dIFH qAJmV06J1h7EjqCnde6w6n6HYy0ZJ/bawTEqiwqrz3eClnqdOT3Ku+bxdcANH4tsQlnh yTwkKH2z2J1v55oE9lESUrvWqR2y3A8NCW2V4gdT/ldT+bDyfNdc/gTZZM352N0Prm2x n2xQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=f5zDXP45; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 16si1499026pfr.26.2019.03.22.04.22.13; Fri, 22 Mar 2019 04:22:29 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=f5zDXP45; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728514AbfCVLVD (ORCPT + 99 others); Fri, 22 Mar 2019 07:21:03 -0400 Received: from mail.kernel.org ([198.145.29.99]:47456 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728504AbfCVLVC (ORCPT ); Fri, 22 Mar 2019 07:21:02 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.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 1A35621917; Fri, 22 Mar 2019 11:21:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1553253661; bh=HF4fP++xF/Ho9cc3sFsCcOeY6eeeukjDI7rehcOPeG4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=f5zDXP45RTLHSRBGuVuE7ACuEMZh6/QGZ8/eXLIOgQtTOD7wNeAT+FGVAXHs37yvQ m9j6pisAXBT+vKG9UbvSqnowHnAn/TDVtm5CMfnLADR0e6Quhr++2Ujf3hBk9p8nYm RTlC5LDog3Tqmz1GHz5xA3yChJGoWXYI44UUugsI= 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 3.18 033/134] mac80211: fix miscounting of ttl-dropped frames Date: Fri, 22 Mar 2019 12:14:06 +0100 Message-Id: <20190322111212.146969334@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190322111210.465931067@linuxfoundation.org> References: <20190322111210.465931067@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 3.18-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 ea3b139875218..ccb822aa62258 100644 --- a/net/mac80211/rx.c +++ b/net/mac80211/rx.c @@ -2179,7 +2179,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