From patchwork Fri Aug 23 13:35:38 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bob Copeland X-Patchwork-Id: 2848827 Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 6B6729F239 for ; Fri, 23 Aug 2013 13:36:28 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id DA5AD20398 for ; Fri, 23 Aug 2013 13:36:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 84D9220320 for ; Fri, 23 Aug 2013 13:36:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754862Ab3HWNgX (ORCPT ); Fri, 23 Aug 2013 09:36:23 -0400 Received: from mail-ie0-f177.google.com ([209.85.223.177]:60738 "EHLO mail-ie0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754805Ab3HWNgX (ORCPT ); Fri, 23 Aug 2013 09:36:23 -0400 Received: by mail-ie0-f177.google.com with SMTP id e14so808664iej.36 for ; Fri, 23 Aug 2013 06:36:22 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=Q/JKXtQCC7Kj8puykRTUHUd2d6IIjLzhhP5vmQat8Ww=; b=YidN7a62U7wyqO/u8ec70qTI6yAjA9VkSoNGT7XWM14TXEwA11N+eVz+5d0XfsMT+p +k6KxBEZ8WGhARrNi3y+x02+2hxH00DyvWlm8/TtlHqaWAl0OZJ+xe0xpB+UxiAuFLp/ HmZEr0PVLa16yTzLtsLqC4te36vpzUo3ont/4XzULYfmkJ7knpX7FVpd0f9EOjFyvoZ5 /FGuUrwq7wtDUxYsHUhFVVNTJ43Uv+Lp8a4hDGRWIoZG5ir1WanTl5TdruBNYcHeXjb7 EnNK4EqPhvgb7gqBwNXFI3JJuefzltBGA7W0/mG69l8zMPAuoHZeO7KVXGi+T7qYY9So Efrg== X-Gm-Message-State: ALoCoQmlJ+l14fqOQzJr7rIreDxqUtDWR0tAioRfmuTBkVVNuArp9jCJ1xRvwm7T4sB0A+peQ/5j X-Received: by 10.50.4.68 with SMTP id i4mr1580899igi.29.1377264982764; Fri, 23 Aug 2013 06:36:22 -0700 (PDT) Received: from hash (CPE0018e7fe5281-CM78cd8ec60a0d.cpe.net.cable.rogers.com. [99.242.255.161]) by mx.google.com with ESMTPSA id ri1sm2990044igc.2.1969.12.31.16.00.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 23 Aug 2013 06:36:22 -0700 (PDT) Received: from bob by hash with local (Exim 4.80) (envelope-from ) id 1VCrWw-0001Oc-6w; Fri, 23 Aug 2013 09:35:58 -0400 From: Bob Copeland To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org Subject: [PATCH] mac80211: assign seqnums for group QoS frames Date: Fri, 23 Aug 2013 09:35:38 -0400 Message-Id: <1377264938-5333-1-git-send-email-me@bobcopeland.com> X-Mailer: git-send-email 1.7.10.4 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-9.7 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 According to 802.11-2012 9.3.2.10, paragraph 4, QoS data frames with a group address in the Address 1 field have sequence numbers allocated from the same counter as non-QoS data and management frames. Without this flag, some drivers may not assign sequence numbers, and in rare cases frames might get dropped. Set the control flag accordingly. Signed-off-by: Bob Copeland --- I noticed seq=0 on DHCP/mDNS frames with mesh on certain hardware (since mesh sends all data frames as QoS). Johannes pointed out this only causes issues if a unicast frame with seq=0 has retries, and if the receiver caches seqnums from multicast frames (mac80211 does not). net/mac80211/tx.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c index 098ae85..3456c04 100644 --- a/net/mac80211/tx.c +++ b/net/mac80211/tx.c @@ -781,9 +781,11 @@ ieee80211_tx_h_sequence(struct ieee80211_tx_data *tx) /* * Anything but QoS data that has a sequence number field * (is long enough) gets a sequence number from the global - * counter. + * counter. QoS data frames with a multicast destination + * also use the global counter (802.11-2012 9.3.2.10). */ - if (!ieee80211_is_data_qos(hdr->frame_control)) { + if (!ieee80211_is_data_qos(hdr->frame_control) || + is_multicast_ether_addr(hdr->addr1)) { /* driver should assign sequence number */ info->flags |= IEEE80211_TX_CTL_ASSIGN_SEQ; /* for pure STA mode without beacons, we can do it */