From patchwork Wed Jun 1 06:33:54 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= X-Patchwork-Id: 628497 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 3rKLF203pSz9s9N for ; Wed, 1 Jun 2016 16:34:45 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=wjiF3ScO; dkim-atps=neutral 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 1b7zjV-0000Fn-DC; Wed, 01 Jun 2016 06:34:25 +0000 Received: from mail-lf0-x244.google.com ([2a00:1450:4010:c07::244]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1b7zjR-0000DP-Q1 for hostap@lists.infradead.org; Wed, 01 Jun 2016 06:34:22 +0000 Received: by mail-lf0-x244.google.com with SMTP id 65so889409lfq.1 for ; Tue, 31 May 2016 23:34:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=LUf75Kt26Lopnb548VKk6FB0Mj9BOuKICm+WdDueftM=; b=wjiF3ScO6YbhBULmiipTOEfCPMGvw2eaebwJxzdVdsgXxclq/9AgodrCNiLTCA2CPj mn/oJJYtCHi0YXJjxMgUFbQJZcq3iDsLZXrtAgclcNBTV/UHw5YzdhGiKfBM7CXpVcHu MKjufzl8hmj0xT37y8ZdZCPZet24qGzqstkyvF/WtiVjQlgE+9X8VDhBKHj4PEZeKaxN eBoMuO8rhudKn9gK3G80RCQGCmIwM5he40lFWNFsEWw8HP7cvrmr3R/CZs23GsWNESzd gK7hNsZLJJo3z2fiIbbJRE8wgDAARypL1JK5/eyArHWOsg9Ftc7Z5WZQ1GXOCnSEHtcv tVXQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=LUf75Kt26Lopnb548VKk6FB0Mj9BOuKICm+WdDueftM=; b=cxVNYYioKuL+P8pT51BWElMxwxTIGINk67/cT66zrImYkOcC0LcM1H5K36r3RgrMGO h84Yn6VzLIVcXBkCH9gXtBNWm2lS+YbRBl95Xyi6X+jfUnsQ43FSeDrnqa44Fy27iFRc +qKjMdI1e5Um99ay12ZPeloJ26Nhpx7Yom5CNjxPAVAwmog1cjD3tieZi29dyaJkBvpi SPo+ayD42zGd6hxHEIOk9IGPg0/H3RJ2TDxwyYncLt/qPq1sSMVhbGgZRZvPMi7cttDM JDch3jOwi1kTvq9eVujhwmWGjtKaI9E5moW8zXufzGFVlpLjuXi9vi0e9EFeUF3yVoGi 9M8A== X-Gm-Message-State: ALyK8tJXAB/oMb0XOeW0C166t3WD3JsV6FrLNQewJAF15v7/C2EzKGvLpWqyZ01AgKMu7Q== X-Received: by 10.25.40.2 with SMTP id o2mr563806lfo.160.1464762839965; Tue, 31 May 2016 23:33:59 -0700 (PDT) Received: from linux-samsung.lan (ip-194-187-74-233.konfederacka.maverick.com.pl. [194.187.74.233]) by smtp.gmail.com with ESMTPSA id c71sm5386324lfe.27.2016.05.31.23.33.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 31 May 2016 23:33:59 -0700 (PDT) From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= To: Jouni Malinen , hostap@lists.infradead.org Subject: [PATCH] AP: Allow using existing interfaces as a fallback Date: Wed, 1 Jun 2016 08:33:54 +0200 Message-Id: <1464762834-26321-1-git-send-email-zajec5@gmail.com> X-Mailer: git-send-email 1.8.4.5 In-Reply-To: <1464591193-13306-1-git-send-email-zajec5@gmail.com> References: <1464591193-13306-1-git-send-email-zajec5@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160531_233422_029983_BC3F26CA X-CRM114-Status: GOOD ( 12.50 ) X-Spam-Score: -2.5 (--) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-2.5 points) pts rule name description ---- ---------------------- -------------------------------------------------- 0.2 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends in digit (zajec5[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (zajec5[at]gmail.com) -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [2a00:1450:4010:c07:0:0:0:244 listed in] [list.dnswl.org] 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: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= Sender: "Hostap" Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Some drivers (e.g. brcmfmac) may not support deleting virtual interfaces. In such cases we can start AP interfaces once only. On next tries be should try to use existing interfaces as a fallback. Signed-off-by: Rafał Miłecki --- src/ap/hostapd.c | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/src/ap/hostapd.c b/src/ap/hostapd.c index 42c1aaa..4e0de0c 100644 --- a/src/ap/hostapd.c +++ b/src/ap/hostapd.c @@ -936,16 +936,24 @@ static int hostapd_setup_bss(struct hostapd_data *hapd, int first) } while (mac_in_conf(hapd->iconf, hapd->own_addr)); } - hapd->interface_added = 1; if (hostapd_if_add(hapd->iface->bss[0], WPA_IF_AP_BSS, conf->iface, addr, hapd, &hapd->drv_priv, force_ifname, if_addr, conf->bridge[0] ? conf->bridge : NULL, first == -1)) { - wpa_printf(MSG_ERROR, "Failed to add BSS (BSSID=" - MACSTR ")", MAC2STR(hapd->own_addr)); - hapd->interface_added = 0; - return -1; + /* Try to use existing interface */ + if (hostapd_if_add(hapd->iface->bss[0], WPA_IF_AP_BSS, + conf->iface, hapd->own_addr, hapd, + &hapd->drv_priv, force_ifname, + if_addr, + conf->bridge[0] ? conf->bridge : NULL, + 1)) { + wpa_printf(MSG_ERROR, "Failed to add BSS (BSSID=" + MACSTR ")", MAC2STR(hapd->own_addr)); + return -1; + } + } else { + hapd->interface_added = 1; } if (!addr)