From patchwork Wed Jan 25 17:52:34 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Cavallari X-Patchwork-Id: 137809 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from maxx.maxx.shmoo.com (maxx.shmoo.com [205.134.188.171]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "maxx.shmoo.com", Issuer "CA Cert Signing Authority" (not verified)) by ozlabs.org (Postfix) with ESMTPS id F2811B6F99 for ; Thu, 26 Jan 2012 04:52:59 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id E48619C1D0; Wed, 25 Jan 2012 12:52:57 -0500 (EST) X-Virus-Scanned: amavisd-new at maxx.shmoo.com Received: from maxx.maxx.shmoo.com ([127.0.0.1]) by localhost (maxx.shmoo.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id QT8CH4CDATl6; Wed, 25 Jan 2012 12:52:57 -0500 (EST) Received: from maxx.shmoo.com (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id 7442E17C031; Wed, 25 Jan 2012 12:52:49 -0500 (EST) X-Original-To: mailman-post+hostap@maxx.shmoo.com Delivered-To: mailman-post+hostap@maxx.shmoo.com Received: from localhost (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id EBA8217C031 for ; Wed, 25 Jan 2012 12:52:48 -0500 (EST) X-Virus-Scanned: amavisd-new at maxx.shmoo.com Received: from maxx.maxx.shmoo.com ([127.0.0.1]) by localhost (maxx.shmoo.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id hmUp-jqdkNzb for ; Wed, 25 Jan 2012 12:52:45 -0500 (EST) Received: from smtp1.u-psud.fr (smtp1.u-psud.fr [129.175.33.41]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id C046217C02F for ; Wed, 25 Jan 2012 12:52:43 -0500 (EST) Received: from smtp1.u-psud.fr (localhost [127.0.0.1]) by localhost (MTA) with SMTP id 2348E256203 for ; Wed, 25 Jan 2012 18:52:43 +0100 (CET) Received: from ext.lri.fr (ext.lri.fr [129.175.15.4]) by smtp1.u-psud.fr (MTA) with ESMTP id 06E1C2561EA for ; Wed, 25 Jan 2012 18:52:43 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by ext.lri.fr (Postfix) with ESMTP id 08B0740617 for ; Wed, 25 Jan 2012 18:52:43 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at lri.fr Received: from ext.lri.fr ([127.0.0.1]) by localhost (ext.lri.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id pNQ-YA4J9-fj for ; Wed, 25 Jan 2012 18:52:42 +0100 (CET) Received: from smtp-ng.lri.fr (smtp [129.175.3.73]) by ext.lri.fr (Postfix) with ESMTP id DED6B40166 for ; Wed, 25 Jan 2012 18:52:42 +0100 (CET) Received: from lowerbit.lri.fr (lri25-36 [129.175.25.36]) by smtp-ng.lri.fr (Postfix) with ESMTP id D98FD606A6; Wed, 25 Jan 2012 18:52:42 +0100 (CET) From: Nicolas Cavallari To: hostap@lists.shmoo.com Subject: [RFC 1/2] Support fixing the BSSID in IBSS mode. Date: Wed, 25 Jan 2012 18:52:34 +0100 Message-Id: <1327513955-9992-1-git-send-email-cavallar@lri.fr> X-Mailer: git-send-email 1.7.8.3 Cc: Nicolas Cavallari X-BeenThere: hostap@lists.shmoo.com X-Mailman-Version: 2.1.9 Precedence: list List-Id: HostAP Project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: hostap-bounces@lists.shmoo.com Errors-To: hostap-bounces@lists.shmoo.com When the "bssid=" option is set for an IBSS network and ap_scan = 2, ask the driver to fix this BSSID, if possible. Previously, any "bssid=" option were ignored in IBSS mode when ap_scan=2. Signed-hostap: Nicolas Cavallari --- Whould like to know if it is the right approach, driver-wise and configuration-wise. I'm not aware of any program specifying a BSSID when creating an IBSS network, except NetworkManager that does it only when the user requests it. src/drivers/driver.h | 7 +++++++ wpa_supplicant/wpa_supplicant.c | 7 +++++++ 2 files changed, 14 insertions(+), 0 deletions(-) diff --git a/src/drivers/driver.h b/src/drivers/driver.h index d72c83b..d0cddd4 100644 --- a/src/drivers/driver.h +++ b/src/drivers/driver.h @@ -516,6 +516,13 @@ struct wpa_driver_associate_params { * STA mode: bits 0..3 UAPSD enabled for VO,VI,BK,BE */ int uapsd; + + /** + * fixed_bssid - Whether to force this BSSID in IBSS Mode. + * 1 = Fix this BSSID and prevent merges. + * 0 = Do not fix BSSID. + */ + int fixed_bssid; }; enum hide_ssid { diff --git a/wpa_supplicant/wpa_supplicant.c b/wpa_supplicant/wpa_supplicant.c index 68b80b9..47366e1 100644 --- a/wpa_supplicant/wpa_supplicant.c +++ b/wpa_supplicant/wpa_supplicant.c @@ -1364,6 +1364,13 @@ void wpa_supplicant_associate(struct wpa_supplicant *wpa_s, params.ssid = ssid->ssid; params.ssid_len = ssid->ssid_len; } + + if (ssid->mode == WPAS_MODE_IBSS && ssid->bssid_set + && wpa_s->conf->ap_scan == 2) { + params.bssid = ssid->bssid; + params.fixed_bssid = 1; + } + if (ssid->mode == WPAS_MODE_IBSS && ssid->frequency > 0 && params.freq == 0) params.freq = ssid->frequency; /* Initial channel for IBSS */