Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp200132imj; Thu, 14 Feb 2019 18:32:30 -0800 (PST) X-Google-Smtp-Source: AHgI3IYoVstMB00n+8FgtoHBvYtMvr8Phx+86VhkhATwevlqQooZjq/CZcamllAd7Ciwkn0xa32w X-Received: by 2002:aa7:8286:: with SMTP id s6mr7311358pfm.63.1550197950145; Thu, 14 Feb 2019 18:32:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550197950; cv=none; d=google.com; s=arc-20160816; b=A5BUtoyOB88vZj8vIeNrak9FNjLaY+Kengbj9WCbZfkCO9UJP6VqX0QlkM+SYk5TZN odO1amOo9iFLZnzTUzwiWdpJGRXM/ZL0CpMFRFCNUK7IL4AU2Z0FSxDvYAyhqgbkdhuq S6htLGYJIlrnyt5EYsU7Ty+O6t3ux300kUSLYZjW0i1gSdLgOwiat/NdLlYnjkFTdWM3 z5ZYyT0MbQheL6sSGLaZ9pJ0MrNtSqKkkfcfJkuwr/po7x2VgNVANzIO+q8h9UJNLlbW EUcOpVOorqumkq8BgbvpOg0ZgpHruKqLC+b3vLng4zuo+jrn02kqVlayNEyRYs1LGpgp xkwg== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Cjv3cE6V/zlNxQhenIQPevoRQ+8KfMB5Bgtn1aBvFVw=; b=WiEW9/vP/Vsya+OQvNS7dVeov4Io+8uR0QGF5/QHVGZot2EHz9xWkwrBCUcVhYLqoy DIE1L/rjTzDK2MUyh4cTQin2MTDp9+BukBA8r2KaQmDxgA+qbux9z5R1i/nrW13lylcJ gf6/fIYSbhdmU1WIcJvXWUFAk9gbUWaKpzuxIy1ui9KmNmS8DATwbI92iBP9QAhXn74l Cmpe0/W+yr8rthPa5ulsioouLQclt6c8dzA9Lv1w+NKPhIVVT/n0hecFCS1044oAxkEv 10xkYpXYZrMIwHOdWNlURhzbqCDZjTm1f/yOj1cKBYTuNjEg9kMS0q3piyRnKAmli+IG 6Xvg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Jrk94+X3; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v11si2379558pgb.276.2019.02.14.18.32.14; Thu, 14 Feb 2019 18:32:30 -0800 (PST) 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=Jrk94+X3; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732367AbfBOCR2 (ORCPT + 99 others); Thu, 14 Feb 2019 21:17:28 -0500 Received: from mail.kernel.org ([198.145.29.99]:55526 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2406050AbfBOCP6 (ORCPT ); Thu, 14 Feb 2019 21:15:58 -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 2CD7E20643; Fri, 15 Feb 2019 02:15:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1550196958; bh=arsGKCmVJULVPn0K4Hu/RIO/mL0V208JPuN4cTV2TQE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Jrk94+X3azX2W6yaKKGgNzrwwYnoyjZCutvVwR1GqAShV3VnBMixVnHKxnLqTQoPN EYw7RhN0/rj73baw28FlyspJamvMGCFABQ3f+6CcsauR6ir7+6tm7/ikW4Q45AS1+n 8S9txiEskBoP0grnLXMTHE/W8kD5eFP3dJ4kmX18= 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 3.18 07/16] mac80211: fix miscounting of ttl-dropped frames Date: Thu, 14 Feb 2019 21:15:37 -0500 Message-Id: <20190215021546.179605-7-sashal@kernel.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190215021546.179605-1-sashal@kernel.org> References: <20190215021546.179605-1-sashal@kernel.org> MIME-Version: 1.0 X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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 ea3b13987521..ccb822aa6225 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