Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp197706imj; Thu, 14 Feb 2019 18:29:27 -0800 (PST) X-Google-Smtp-Source: AHgI3IYl1l+Ntf3F46w23jSwjsos+Ko5HzbhbAAFIwNK+nCRkK7mJcPm+/5LiEGzi/SgM/d8SeH+ X-Received: by 2002:a62:221a:: with SMTP id i26mr7324036pfi.174.1550197767484; Thu, 14 Feb 2019 18:29:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550197767; cv=none; d=google.com; s=arc-20160816; b=hhTjDxnu+d5aVQqVy0FFXUyNsRKE3zuSGhoK1gcZtGz861L2t16CGMabO9/tPnEy5l wMCZWKO4WFUaJCTRL0z6SonZdFa9vEQgKVlZsvQ0oWoZlrrLPA690IP+91wDc9hphCIT PJMHY0t1FTxrSYfZlCLeH6/Er1gho7GzeO01O897YSOLP9UAjKEaN2cHsvvFvQfShRUc 8GheIvQu6vjpJ4ixjSTY4m57E33CaUAD0KAnPWL6w5lMxTvzXTyWN4syLcGTCzcYD/L9 TaEoDFSZ5ugMNEqHap7smMrxP4gYz1FDPJug7O4aPTPxjZfPPBYWdIm3QSrA1Yzea1jV f6JA== 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=qKi0YNrHxRHmXwhZqRuA8pXG6ovVskQAGj2HPgnwkiI=; b=aOVujszt1pfOBm2nqzorvSPpgM8XvP3Cxnolka2mm9eZ77UkSI49RWG7ujmSlJMEqe Hccv9NuWH4Ho2xd/TP9cnF+FZh6kd9jHuanyxsGJTwdl3Ml66ZMiJBrFi4QkhNQCqPlf gYy59pXzHJ7RHuA5cna0SElb6iFYbTf3Mc6OnznJW3CcF0t6MibakehsYhEgyIimX9e6 G1paW9G/pe2MW30n0Y+aqGeJMxgsQMngAVcZzC3WssakkD6NJAkpU3/gjGeda0Gq0DsI XLPyDAwM7LGd9z7StOzCMAUVfEaNBeFC7KOTWed3WCYD6ZlrFG5Y+Zp6wQQcA++XiJnz J1JA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=z+E1qMhu; 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 c8si3816515pgq.300.2019.02.14.18.29.12; Thu, 14 Feb 2019 18:29:27 -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=z+E1qMhu; 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 S2390031AbfBOCKF (ORCPT + 99 others); Thu, 14 Feb 2019 21:10:05 -0500 Received: from mail.kernel.org ([198.145.29.99]:50120 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389658AbfBOCKA (ORCPT ); Thu, 14 Feb 2019 21:10:00 -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 32913222A1; Fri, 15 Feb 2019 02:09:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1550196599; bh=iAu4afID//rMfOpd+oY+tySOsJ+NxK0yLKYuM2dPOwY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=z+E1qMhu2HN07//PRxBdVPna9KFDRMLlgzuYrWVQ1ZOTBFFrZmNU08t0jjdJSvfwJ 1DsRYvsv+b2PRUw9DYa/kDnx03l0roxFn3wtcSdJJXKNE1FL4Jwj2LPWamYXPZZf+E 0LSGIv8ST1IExW56gQJsx1IU5POC3rtsChDy8BME= 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.20 36/77] mac80211: fix miscounting of ttl-dropped frames Date: Thu, 14 Feb 2019 21:08:14 -0500 Message-Id: <20190215020855.176727-36-sashal@kernel.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190215020855.176727-1-sashal@kernel.org> References: <20190215020855.176727-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 428f7ad5f9b5..ef215d0e99b0 100644 --- a/net/mac80211/rx.c +++ b/net/mac80211/rx.c @@ -2710,7 +2710,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