From patchwork Wed Feb 24 11:53:39 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: michael-dev X-Patchwork-Id: 587322 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2001:1868:205::9]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id B542014090A for ; Wed, 24 Feb 2016 22:55:45 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1aYY2b-0000Xr-EY; Wed, 24 Feb 2016 11:55:37 +0000 Received: from mail.fem.tu-ilmenau.de ([141.24.220.54]) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1aYY1z-0006yN-16 for hostap@lists.infradead.org; Wed, 24 Feb 2016 11:55:06 +0000 Received: from localhost (localhost [127.0.0.1]) by mail.fem.tu-ilmenau.de (Postfix) with ESMTP id A0FF46511; Wed, 24 Feb 2016 12:54:23 +0100 (CET) X-Virus-Scanned: amavisd-new at fem.tu-ilmenau.de Received: from mail.fem.tu-ilmenau.de ([127.0.0.1]) by localhost (mail.fem.tu-ilmenau.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id YUXTM2OxogJv; Wed, 24 Feb 2016 12:54:23 +0100 (CET) Received: from wlancontroller-farm.fem.tu-ilmenau.de (n145.fem.tu-ilmenau.de [141.24.52.145]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mail.fem.tu-ilmenau.de (Postfix) with ESMTPSA; Wed, 24 Feb 2016 12:54:23 +0100 (CET) From: michael-dev@fami-braun.de To: hostap@lists.infradead.org Subject: [PATCH 33/44] STA: avoid driver warning when configuring not connected STAs for WPA Date: Wed, 24 Feb 2016 12:53:39 +0100 Message-Id: <1456314830-12935-34-git-send-email-michael-dev@fami-braun.de> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1456314830-12935-1-git-send-email-michael-dev@fami-braun.de> References: <1456314830-12935-1-git-send-email-michael-dev@fami-braun.de> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160224_035459_455110_BAE59068 X-CRM114-Status: UNSURE ( 9.38 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -4.2 (----) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-4.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at http://www.dnswl.org/, medium trust [141.24.220.54 listed in list.dnswl.org] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: projekt-wlan@fem.tu-ilmenau.de, Michael Braun MIME-Version: 1.0 Sender: "Hostap" Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org From: Michael Braun Signed-off-by: Michael Braun --- src/ap/sta_info.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/src/ap/sta_info.c b/src/ap/sta_info.c index e5976f9..a3ff592 100644 --- a/src/ap/sta_info.c +++ b/src/ap/sta_info.c @@ -994,11 +994,21 @@ skip_counting: if (wpa_auth_sta_set_vlan(sta->wpa_sm, sta->vlan_id) < 0) wpa_printf(MSG_INFO, "Failed to update VLAN-ID for WPA"); - ret = hostapd_drv_set_sta_vlan(iface, hapd, sta->addr, sta->vlan_id); - if (ret < 0) { + if (sta->flags & (WLAN_STA_AUTH | WLAN_STA_ASSOC)) { + ret = hostapd_drv_set_sta_vlan(iface, hapd, sta->addr, + sta->vlan_id); + if (ret < 0) + hostapd_logger(hapd, sta->addr, + HOSTAPD_MODULE_IEEE80211, + HOSTAPD_LEVEL_WARNING, "could not bind " + "the STA entry to vlan_id=%d", + sta->vlan_id); + } else { + ret = -1; hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_IEEE80211, - HOSTAPD_LEVEL_DEBUG, "could not bind the STA " - "entry to vlan_id=%d", sta->vlan_id); + HOSTAPD_LEVEL_INFO, "station not authenticated, " + "so skip setting vlan to vlan_id=%d", + sta->vlan_id); } /* During 1x reauth, if the vlan id changes, then remove the old id. */