Received: by 2002:ac0:aed5:0:0:0:0:0 with SMTP id t21csp2284428imb; Mon, 4 Mar 2019 00:47:16 -0800 (PST) X-Google-Smtp-Source: AHgI3IbB+YBXsuIohrl1Fh+8CYb7EFQ8OQYybhgHSZOBBhTOVM7odPIyBhs0KhFYkdbmy2gxWizH X-Received: by 2002:aa7:83cb:: with SMTP id j11mr19141661pfn.117.1551689236500; Mon, 04 Mar 2019 00:47:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551689236; cv=none; d=google.com; s=arc-20160816; b=HtSr5VvuLbbqiq5vdqhTje+x5AyG92m4iZD4+qvy8qDdX2JpubcWX3orvSW0mKaX0E OsPqObgqsUMg9YOXil8TZjrc2AwlLHy93s3x6oz/mvQ+SvWMCFp6x9o0RfHwArAagDTU gTLjRIVIJY6xwZVg9/a6IBKI50K5HHyofzAZa+F+C2pRCfPrjygTnWjPtXUjX0CHT+he ul0srXolng/YL8CIL/Y8TWLRoM39ZbnEOMfqJCYrtKlH4Smyw9HoUPzeB33XPxdjhz6a 4VA/ehNFmMB5cjRowa798q/BAY8qk1T12ZEoSbL7LYj6PtMihdj+FsQSvAHVLFAKwLex QE4w== 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=zJWsWguyROFBNl37QUf+uD4ZUhz8mNqvtpTOR6TFvls=; b=j4Gy3/1wmIeMv7bEszFpw9fSSYyMdskp6toDubVk2tV9554kw2cE93QGSol8YD95ui 9ZMBnrMXb9dMT13jjUPJWekwinlnBY9fFwm24V+UBJCJDshFFr8dPP0Pzh6Cq1K/npLk uSkkL1p6CAJooR5uZ2JcS3WJ6rDl5pQwpt8oPSpXoOD+D+plKPSMsPP8/BZE1mFAQHrh bUsNiNKzNZOhWxKaGPLJ5HnnSNnBF+e088RhTxf4K3zDS6O7jTneviGNinlaq7JRovze spCUZHQLL1aNgRwj8sTv5dG3xM1hDSFnwlFhCGu1btnUf6gQyv0gcEX0SPdKbSkwwWY4 4OWg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=wcci6t7K; 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 l14si4906657pfj.112.2019.03.04.00.47.01; Mon, 04 Mar 2019 00:47:16 -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=wcci6t7K; 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 S1726173AbfCDIqp (ORCPT + 99 others); Mon, 4 Mar 2019 03:46:45 -0500 Received: from mail.kernel.org ([198.145.29.99]:43858 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726384AbfCDIZB (ORCPT ); Mon, 4 Mar 2019 03:25:01 -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 1D88120823; Mon, 4 Mar 2019 08:24:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1551687900; bh=HtXfairTa1uoNWl6CSV1X7agk/9/7uEk1t5mIoaKkp4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=wcci6t7KHo7WfNUS1F/ThzqTLekm2ZJMrSc5itQ7FwMpCXIFLI0PATtwD/iDRDCE7 2An9DGVliPdFParxPuzbvsqEF7zOcAqepii69vfYgkehDkSy9mNu6fQbw4wVJOaz7R gtqfN/vzWeKVQMHNu8Lz7Q5zE55ihj+wv/uVn7WI= 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.14 24/52] mac80211: fix miscounting of ttl-dropped frames Date: Mon, 4 Mar 2019 09:22:22 +0100 Message-Id: <20190304081618.618135431@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190304081617.159014799@linuxfoundation.org> References: <20190304081617.159014799@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.14-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 c7ac1a480b1dd..dfc2af6833aff 100644 --- a/net/mac80211/rx.c +++ b/net/mac80211/rx.c @@ -2533,7 +2533,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