From patchwork Thu Jan 17 21:32:42 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bob Copeland X-Patchwork-Id: 10769145 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id BD01E17FB for ; Thu, 17 Jan 2019 21:32:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id ADD5330207 for ; Thu, 17 Jan 2019 21:32:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A1AA630218; Thu, 17 Jan 2019 21:32:59 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1ADAB30207 for ; Thu, 17 Jan 2019 21:32:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729361AbfAQVc5 (ORCPT ); Thu, 17 Jan 2019 16:32:57 -0500 Received: from mail-it1-f195.google.com ([209.85.166.195]:34816 "EHLO mail-it1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726905AbfAQVc5 (ORCPT ); Thu, 17 Jan 2019 16:32:57 -0500 Received: by mail-it1-f195.google.com with SMTP id p197so3202312itp.0 for ; Thu, 17 Jan 2019 13:32:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bobcopeland-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=EjtuqvuYka0FtsNuAJcGMBJTdM8yYScDGvHH1CBu7rw=; b=y0e35ijbYx35MCCgKbRlc7vN6nIc1HIyFF3GtvyTNNZccSIC/vYe2MviVz7CkroZcD 95sikBUJAxgBkrXPu0rW6tYypeSytYPOlMq1eNkKPBnCEE3peR6Z1m1NAdP10LVMV2uK m5aVruq151L4BJTt03YsZ+vYHOIVr8rBkGZndmJhr+bOLZAbUy7cAv7bljVgaXaODoFi /lfIz+1AStJMRk1I5fhZID/9mhOPwtDT31r3wzz99jOzJVBU08gHmE9qHWFCI43biobZ 1wsFGfkrNOtFL3fvfQ07Ah9gGu+KeZMpJJfT7XmZICbw85Nb3hk8a4yDUVblWT1YnZ60 SeOw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=EjtuqvuYka0FtsNuAJcGMBJTdM8yYScDGvHH1CBu7rw=; b=L+htOFpOZndQwD5ldP4wzf+TyHdOowD11X3lcp+KV94UatM6LMZZOHu/hl3s8/1Wq4 Cnz0mKlikq0TPnnr8Ber45tAzmCXTg8Xfm0iqi9j3jYXVuIARwBJ72kUbWFAMR4H1ngH HPgoBlBjAsPrO5pIRzr8K8I8u+HvW2TSk2JIbsMl0c0+bG6TUT3+XoMIDbwGpoaqFWty mTwZAFT0B9QAd5ylHpFT6Hoe7n4RAz8ccK5SIKm+xEjCQA6T/v8zgCD6AjDfV7icA0jp bEE8TZitEy/UjzGxFzC0DJxwdNJ/vXS9H9PcYtZ++d1lX2RhZHyZa9ZS8Wkr3ERlPTAD LxyA== X-Gm-Message-State: AJcUukdGv+ld730S8FD3HHkggUIRTjPeF1LciDoFYdsZMHK3V8u0I5XY qSdDdefrbVDb1yb42fdpnCeAov95Mag= X-Google-Smtp-Source: ALg8bN4ZJemiZZC3qHnUsa2Y9Fu/wzjDjHcBImTfmIeU2+NghBDwZjs7yJ/EINl1kZqK4aB0PcyN7Q== X-Received: by 2002:a24:5c90:: with SMTP id q138mr8955375itb.32.1547760776886; Thu, 17 Jan 2019 13:32:56 -0800 (PST) Received: from hash (CPE30b5c2fb365b-CM18593342f28f.cpe.net.cable.rogers.com. [99.232.51.173]) by smtp.gmail.com with ESMTPSA id j7sm949870iom.80.2019.01.17.13.32.56 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 17 Jan 2019 13:32:56 -0800 (PST) Received: from bob by hash with local (Exim 4.92-RC4) (envelope-from ) id 1gkFHT-0008EN-H0; Thu, 17 Jan 2019 16:32:55 -0500 From: Bob Copeland To: Johannes Berg Cc: linux-wireless@vger.kernel.org, kernel-team@fb.com, Bob Copeland , Bob Copeland Subject: [PATCH] mac80211: fix miscounting of ttl-dropped frames Date: Thu, 17 Jan 2019 16:32:42 -0500 Message-Id: <20190117213242.31588-1-me@bobcopeland.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- 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 dddd498e1338..ffd312b8c432 100644 --- a/net/mac80211/rx.c +++ b/net/mac80211/rx.c @@ -2531,7 +2531,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; }