From patchwork Thu Jul 11 18:29:49 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Wunderlich X-Patchwork-Id: 2826569 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 78404C0AB2 for ; Thu, 11 Jul 2013 18:29:59 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 97883201DE for ; Thu, 11 Jul 2013 18:29:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 31D73201CA for ; Thu, 11 Jul 2013 18:29:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756449Ab3GKS3z (ORCPT ); Thu, 11 Jul 2013 14:29:55 -0400 Received: from nick.hrz.tu-chemnitz.de ([134.109.228.11]:35430 "EHLO nick.hrz.tu-chemnitz.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756436Ab3GKS3z (ORCPT ); Thu, 11 Jul 2013 14:29:55 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tu-chemnitz.de; s=dkim2010; h=Message-Id:Date:Subject:Cc:To:From; bh=yHWCVcsfjPz0gICp1Wk3KMZrXRVifhzhcqoEPXsJpZ4=; b=GPHyyTyAjSyhRw7vKrSffO1V7enR/oPKWr+q52bnMTNLTxojfPNVDQPrIwoPSnm0Q5ggE6P1vK0OHCW/bv4eN9xH5H4Or7dnAFlJD3RygS8ZUnoIH2E6WMR6tPjeP0vCqXBesMsl2X75ArX5hLIH7AnG5gAm0/pMNgYcLa7cDEc=; Received: from p4ffe579c.dip0.t-ipconnect.de ([79.254.87.156] helo=pandem0nium) by nick.hrz.tu-chemnitz.de with esmtpsa (TLSv1:DHE-RSA-AES128-SHA:128) (Exim 4.80.1) (envelope-from ) id 1UxLcn-00008J-OG; Thu, 11 Jul 2013 20:29:54 +0200 Received: from dotslash by pandem0nium with local (Exim 4.80) (envelope-from ) id 1UxLcm-0001dv-4K; Thu, 11 Jul 2013 20:29:52 +0200 From: Simon Wunderlich To: Johannes Berg Cc: linux-wireless@vger.kernel.org, Simon Wunderlich Subject: [PATCH] mac80211: fix off-by-one regression in ibss beacon generation Date: Thu, 11 Jul 2013 20:29:49 +0200 Message-Id: <1373567389-6287-1-git-send-email-siwu@hrz.tu-chemnitz.de> X-Mailer: git-send-email 1.7.10.4 X-purgate: clean X-purgate-type: clean X-purgate-ID: 154106::1373567393-000004FE-D9C2FA7A/0-0/0-0 X-Scan-AV: nick.hrz.tu-chemnitz.de; 2013-07-11 20:29:53; ded6e510cc50de48ca0333ba8e5f20ad X-Scan-SA: nick.hrz.tu-chemnitz.de; 2013-07-11 20:29:54; abdf3cca89f52405ba3fc5d02aa97860 X-Spam-Score: -1.0 (-) Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=unavailable 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 There is an off-by-one error in the beacon generation for the ibss mode, falsely a rate the extended supported rates which was already added to supported rates, messing up the beacon. This was introduced by commit "mac80211: select and adjust bitrates according to channel mode". Signed-off-by: Simon Wunderlich --- I obviously missed that, sorry. :( This was not visible in 5/10 MHz as CCK rates are missing in this mode. You might want to squash this one ... --- net/mac80211/ibss.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/net/mac80211/ibss.c b/net/mac80211/ibss.c index 83197c3..5e6836c 100644 --- a/net/mac80211/ibss.c +++ b/net/mac80211/ibss.c @@ -168,8 +168,10 @@ static void __ieee80211_sta_join_ibss(struct ieee80211_sub_if_data *sdata, if (basic_rates & BIT(ri)) basic = 0x80; *pos++ = basic | (u8) rate; - if (++rates_added == 8) + if (++rates_added == 8) { + ri++; /* continue at next rate for EXT_SUPP_RATES */ break; + } } if (sband->band == IEEE80211_BAND_2GHZ) {