From patchwork Wed Dec 23 11:12:56 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Ivanov X-Patchwork-Id: 560453 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from arrakis.dune.hu (arrakis.dune.hu [78.24.191.176]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 04BE7140BFC for ; Wed, 23 Dec 2015 22:13:14 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=ubnt.com header.i=@ubnt.com header.b=cAn7RYK6; dkim-atps=neutral Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id 6F66E2815DF; Wed, 23 Dec 2015 12:12:47 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on arrakis.dune.hu X-Spam-Level: X-Spam-Status: No, score=-1.5 required=5.0 tests=BAYES_00,T_DKIM_INVALID autolearn=unavailable version=3.3.2 Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id 4676728081D for ; Wed, 23 Dec 2015 12:12:41 +0100 (CET) X-policyd-weight: using cached result; rate: -8.5 Received: from mail-lf0-f41.google.com (mail-lf0-f41.google.com [209.85.215.41]) by arrakis.dune.hu (Postfix) with ESMTPS for ; Wed, 23 Dec 2015 12:12:38 +0100 (CET) Received: by mail-lf0-f41.google.com with SMTP id z124so140155708lfa.3 for ; Wed, 23 Dec 2015 03:12:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ubnt.com; s=google; h=date:from:to:subject:message-id:mime-version:content-type :content-transfer-encoding; bh=JJTpz/ozCZvT5ItTrZ02kRjt3XuyM/IIZHUV39zkRj8=; b=cAn7RYK6N1338j8D8TWxOyAabih4aObNSyxKVbuq/soqEjIBl3jnDx85E0oCefSUyx xCctuXhRFHIK2Mp4j+XjFgm/ZnJOlkZCY581y6LYc/GROueXyDQqYoDQzCQV7MfarsK4 d+cVVNIn59sT+17ZfkxLRzd1kLjYCq625hcgg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:subject:message-id:mime-version :content-type:content-transfer-encoding; bh=JJTpz/ozCZvT5ItTrZ02kRjt3XuyM/IIZHUV39zkRj8=; b=GfPNMSD0M7HHUxNG6ykinq23XUdBPu0V72KkCULiZ1Y7os+pWgiRRFAbKbN2dQ4Si6 xqgX6ZSBoNDohw2vIYx59z4l5bhynssLDS6+AJ3fC9Fl0h2i1PPJs0CFTbJyf3yYESXL wyH2UkPEKlyhW1z1jnsMA6f79aRXc5tdMIHKZ7HeBFf6uKgubjUhkPDsyD3WHuN31HOt yONybLubwEnpSWmVXvi0tl4dBG4cu2VbElBf5mFQe77ijHH6rFLSF04unOM/mVtKV9ea Hz41pSQFpC9ZnSNZi6Ey6AmuPdhFPrO0u8WD3zdjHtpVWO9PxytaVimViQJjWzZZ9R3r ZcBg== X-Gm-Message-State: ALoCoQm0WYcEpmEOw78DwsKJ3GrUqnjO1PsbMsHF6wqqDLSPTOJEMu2GnApEEvuQ5fesu7R1KDdDc9eYuxQ26cv/R9k8Y0qG7SqSci1p4VSiwwsBpL2ALRWNBpAC806r74d8Fc61RHhiaYJw5Ffsen2FCpWJaGN+j7jDZD0flMbh3xs5tyj+ohoGvm8QDG5yuLurZJizIJvlWwre70toRWEZUQ56FK6UqQ== X-Received: by 10.25.41.77 with SMTP id p74mr8125165lfp.22.1450869178014; Wed, 23 Dec 2015 03:12:58 -0800 (PST) Received: from di ([80.233.186.214]) by smtp.gmail.com with ESMTPSA id k12sm6424516lfg.29.2015.12.23.03.12.57 for (version=TLSv1/SSLv3 cipher=OTHER); Wed, 23 Dec 2015 03:12:57 -0800 (PST) Date: Wed, 23 Dec 2015 13:12:56 +0200 From: Dmitry Ivanov To: openwrt-devel@lists.openwrt.org Message-Id: <20151223131256.c88e5b41b61994a574b25740@ubnt.com> X-Mailer: Sylpheed 3.5.0beta1 (GTK+ 2.24.25; x86_64-pc-linux-gnu) Mime-Version: 1.0 Subject: [OpenWrt-Devel] [PATCH] wpa_supplicant: set regulatory domain the same way as hostapd X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: openwrt-devel-bounces@lists.openwrt.org Sender: "openwrt-devel" In sta-only configuration, wpa_supplicant needs correct regulatory domain because otherwise it may skip channel of its AP during scan. Another alternative is to fix "iw reg set" in mac80211 netifd script. Currently it fails if some phy has private regulatory domain which matches configured one. Signed-off-by: Dmitry Ivanov --- package/network/services/hostapd/files/netifd.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/package/network/services/hostapd/files/netifd.sh b/package/network/services/hostapd/files/netifd.sh index 5541e4d..6aca7f7 100644 --- a/package/network/services/hostapd/files/netifd.sh +++ b/package/network/services/hostapd/files/netifd.sh @@ -536,9 +536,15 @@ wpa_supplicant_prepare_interface() { _w_modestr="mode=1" } + local country_str= + [ -n "$network_bridge" ] && { + country_str="country=$country" + } + wpa_supplicant_teardown_interface "$ifname" cat > "$_config" <