From patchwork Sun Feb 28 10:13:46 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jouni Malinen X-Patchwork-Id: 82787 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o1SADwbG000703 for ; Sun, 28 Feb 2010 10:13:58 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1031751Ab0B1KN5 (ORCPT ); Sun, 28 Feb 2010 05:13:57 -0500 Received: from 128-177-27-249.ip.openhosting.com ([128.177.27.249]:40666 "EHLO jmalinen.user.openhosting.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1031745Ab0B1KN4 (ORCPT ); Sun, 28 Feb 2010 05:13:56 -0500 Received: from jm (a88-112-110-114.elisa-laajakaista.fi [88.112.110.114]) (authenticated bits=0) by jmalinen.user.openhosting.com (8.13.8/8.13.8) with ESMTP id o1SADlAi032067 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 28 Feb 2010 05:13:48 -0500 Received: by jm (sSMTP sendmail emulation); Sun, 28 Feb 2010 12:13:47 +0200 Date: Sun, 28 Feb 2010 12:13:46 +0200 From: Jouni Malinen To: "John W. Linville" , Johannes Berg Cc: linux-wireless@vger.kernel.org Subject: [PATCH] mac80211: Fix reassociation processing (within ESS roaming) Message-ID: <20100228101346.GA8962@jm.kir.nu> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-06-14) Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Sun, 28 Feb 2010 10:13:58 +0000 (UTC) --- uml.orig/net/mac80211/mlme.c 2010-02-28 11:22:00.000000000 +0200 +++ uml/net/mac80211/mlme.c 2010-02-28 11:51:28.000000000 +0200 @@ -1893,8 +1893,20 @@ int ieee80211_mgd_assoc(struct ieee80211 mutex_lock(&ifmgd->mtx); if (ifmgd->associated) { - mutex_unlock(&ifmgd->mtx); - return -EALREADY; + if (!req->prev_bssid || + memcmp(req->prev_bssid, ifmgd->associated->bssid, + ETH_ALEN)) { + /* + * We are already associated and the request was not a + * reassociation request from the current BSS, so + * reject it. + */ + mutex_unlock(&ifmgd->mtx); + return -EALREADY; + } + + /* Trying to reassociate - clear previous association state */ + ieee80211_set_disassoc(sdata); } mutex_unlock(&ifmgd->mtx);