From patchwork Thu Jul 17 14:14:30 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arik Nemtsov X-Patchwork-Id: 4575811 Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 2FC8AC0514 for ; Thu, 17 Jul 2014 14:15:16 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4C70D20120 for ; Thu, 17 Jul 2014 14:15:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E44B32018E for ; Thu, 17 Jul 2014 14:15:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933817AbaGQOO7 (ORCPT ); Thu, 17 Jul 2014 10:14:59 -0400 Received: from mail-wg0-f44.google.com ([74.125.82.44]:60438 "EHLO mail-wg0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933854AbaGQOOZ (ORCPT ); Thu, 17 Jul 2014 10:14:25 -0400 Received: by mail-wg0-f44.google.com with SMTP id m15so2115720wgh.15 for ; Thu, 17 Jul 2014 07:14:24 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Sst46KN+8lHrWRTjThHKtGlBpTnZXou+B/2op8RY850=; b=IIh16pfKD7sTybPnOLeR2j7K043QpIGTLoNqzCS+QKcbDvq6ngnvqtpmyMlMHn+ZYw WFrAynzJ+LOWOBmP7u5wSX4PO3DnlZ1NqXP7yqumfNM0VfRf1FJ5n7DLXgvhG2sBU6ni 0jPWWbiq+aaPFGmLvRNg51Vc+qeOGlhTwiYVJpf7A/E1veA/hf8glGEL6jnZcedTDvC3 quAP1rlT3qClcg8h8fUq2FkEE8bRBe4bQTkDCai6sfiNzpHAs843AMZNWxkz3diIH/3O lB5k85UzqCuSoBUUv8+n+98x8dvmSrAkF1s17UDVxqh3KEFFgz6GQxrY4+sCGM+/jsL+ fgCQ== X-Gm-Message-State: ALoCoQnDmw6jqeiWTmGwLu3u6vLzf5SLAH6ONhhu4ba4B5OjRXlYyMU+JqejPIFUj33z8UdhlLGK X-Received: by 10.194.120.35 with SMTP id kz3mr45583694wjb.38.1405606463966; Thu, 17 Jul 2014 07:14:23 -0700 (PDT) Received: from athena.amr.corp.intel.com (46-116-100-31.bb.netvision.net.il. [46.116.100.31]) by mx.google.com with ESMTPSA id ft6sm17691865wic.0.2014.07.17.07.14.22 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 17 Jul 2014 07:14:23 -0700 (PDT) From: Arik Nemtsov To: Cc: Johannes Berg , Arik Nemtsov Subject: [PATCH 14/15] mac80211: ignore frames between TDLS peers when operating as AP Date: Thu, 17 Jul 2014 17:14:30 +0300 Message-Id: <1405606471-30128-15-git-send-email-arik@wizery.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1405606471-30128-1-git-send-email-arik@wizery.com> References: <1405606471-30128-1-git-send-email-arik@wizery.com> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP If the AP receives actions frames destined for other peers, it may mistakenly toggle BA-sessions from itself to a peer. Ignore TDLS data packets as well - the AP should not handle them. Signed-off-by: Arik Nemtsov Reviewed-by: Emmanuel Grumbach --- net/mac80211/rx.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c index 5f572be..5a786d4 100644 --- a/net/mac80211/rx.c +++ b/net/mac80211/rx.c @@ -3129,6 +3129,14 @@ static bool prepare_for_handlers(struct ieee80211_rx_data *rx, if (!ieee80211_is_beacon(hdr->frame_control)) return false; status->rx_flags &= ~IEEE80211_RX_RA_MATCH; + } else if (!ieee80211_has_tods(hdr->frame_control)) { + /* ignore data frames to TDLS-peers */ + if (ieee80211_is_data(hdr->frame_control)) + return false; + /* ignore action frames to TDLS-peers */ + if (ieee80211_is_action(hdr->frame_control) && + !ether_addr_equal(bssid, hdr->addr1)) + return false; } break; case NL80211_IFTYPE_WDS: