From patchwork Sun Aug 9 07:13:10 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gong Cheng X-Patchwork-Id: 505408 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 1F96C140297 for ; Sun, 9 Aug 2015 17:13:34 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=yahoo.com header.i=@yahoo.com header.b=ldj4f2st; dkim-atps=neutral Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id 3939D280950; Sun, 9 Aug 2015 09:12:43 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on arrakis.dune.hu X-Spam-Level: X-Spam-Status: No, score=-1.2 required=5.0 tests=BAYES_00, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, T_DKIM_INVALID, T_RP_MATCHES_RCVD autolearn=no version=3.3.2 Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id C90AF2803E1 for ; Sun, 9 Aug 2015 09:12:38 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 CL_IP_EQ_HELO_IP=-2 (check from: .yahoo. - helo: .nm28-vm1.bullet.mail.ne1.yahoo. - helo-domain: .yahoo.) FROM/MX_MATCHES_HELO(DOMAIN)=-2; rate: -8.5 Received: from nm28-vm1.bullet.mail.ne1.yahoo.com (nm28-vm1.bullet.mail.ne1.yahoo.com [98.138.91.35]) by arrakis.dune.hu (Postfix) with ESMTPS for ; Sun, 9 Aug 2015 09:12:37 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1439104397; bh=LAhU2MKFsWUbDdvF9Rr63UkksfV51PiKcXZRIf/Get0=; h=From:To:Cc:Subject:Date:From:Subject; b=ldj4f2stdFa88/IfoLPXk3fYbF6CCtF+chAfNuhk2gdb65O3ZZ0mBZCYf5weDqxxttaPWpgLX3rZ2rY4lqlG/O7dpBoPyUniHYGT7qk7V9z7eS2JJTRDyyntsAUpmHHzZq8lRBHQgD2nOGx7jNk1AM82fsZhn+ed+0yCo5tMYqIftGJVGrVmr847uiY8hvnzqEuLWo222WG6L1Je0mUmlzocunktt/pZ0YahLBjiEBvYFwiGXVVhnN1BE7T8YgfCfuVIRBdG9kF8W4tfd+G05nlt+X8gjU16BNp4MTMOd9FjCLy0BEhBgXjxuU3LVFYG01hZs/Vk5GCOjQc52A6Jzw== Received: from [98.138.100.118] by nm28.bullet.mail.ne1.yahoo.com with NNFMP; 09 Aug 2015 07:13:17 -0000 Received: from [98.138.84.37] by tm109.bullet.mail.ne1.yahoo.com with NNFMP; 09 Aug 2015 07:13:17 -0000 Received: from [127.0.0.1] by smtp105.mail.ne1.yahoo.com with NNFMP; 09 Aug 2015 07:13:16 -0000 X-Yahoo-Newman-Id: 994537.82513.bm@smtp105.mail.ne1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: 6.aoyOUVM1n1Th2kKjt303foUzrHsItl4X9MNNcxpn_fYya emwLoZuRv335hQISqeJl_bUB7iwrnzPF0FWm2oPusE4gb.BdwwATCi6q_zcM Ho9k5TCnk2XM5NH5ImiBNNRS0m3lectKL27g3zspAdznMIvQq3JrR1UiI2mg 9zBDnTjDTifc0ov3r_u5V_NHZQ175MMgZ_HqkAOtoMGoszLGiPMYvQJoK2qQ DLE0hO72WyPU1xFWcp0CIZSuvAi3W0X51qgPwqCF2ohT_p9u55okUKi.if2t yfgtXL0cGUqkcw8rNXxqSM3NT.dCXGg3J0nOLbX3yNBWIHbMZMHJNeubr3O5 WZYtC_7sOjrwoE7bFFcln1bXZUgpoDDz8YDq3lsbeSNgVTAxV5VMKk6WmnmG HpEGSCvSSAUACsU1tJ..0bjNRuviZ8O4mezcovtN8hK8yKwW8RYQ7K_lAmZD khNhnh8YVGT8SjveaBDWkTFjhr_4iSXmuZeMmizd1IK7RWtQSiHPgeQ0jfLm 8_V6z18erF8MGa1MNwZfdAPPQGncDJg-- X-Yahoo-SMTP: XGGFLU6swBCHDd47vsMwlpYb54K3 From: Gong Cheng To: nbd@openwrt.org Date: Sun, 9 Aug 2015 00:13:10 -0700 Message-Id: <1439104390-14175-1-git-send-email-chengg11@yahoo.com> X-Mailer: git-send-email 1.9.1 Cc: openwrt-devel@lists.openwrt.org Subject: [OpenWrt-Devel] [PATCH] hostapd: Add vlan_file option to netifd.sh 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: , MIME-Version: 1.0 Errors-To: openwrt-devel-bounces@lists.openwrt.org Sender: "openwrt-devel" Other VLAN related options are already being processed in netifd.sh but the vlan_file option is missing. This option allows the mapping of vlan IDs to network interfaces and will be used in dynamic VLAN feature for binding stations to interfaces based on VLAN assignments. The change is done similarly to the wpa_psk_file option. Signed-off-by: Gong Cheng --- package/network/services/hostapd/files/netifd.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/package/network/services/hostapd/files/netifd.sh b/package/network/services/hostapd/files/netifd.sh index a3ffd93..d90ff9b 100644 --- a/package/network/services/hostapd/files/netifd.sh +++ b/package/network/services/hostapd/files/netifd.sh @@ -140,6 +140,7 @@ hostapd_common_add_bss_config() { config_add_int dynamic_vlan vlan_naming config_add_string vlan_tagged_interface vlan_bridge + config_add_string vlan_file config_add_string 'key1:wepkey' 'key2:wepkey' 'key3:wepkey' 'key4:wepkey' 'password:wpakey' @@ -248,7 +249,7 @@ hostapd_set_bss_options() { ownip \ eap_reauth_period dynamic_vlan \ vlan_naming vlan_tagged_interface \ - vlan_bridge + vlan_bridge vlan_file # legacy compatibility [ -n "$auth_server" ] || json_get_var auth_server server @@ -291,6 +292,10 @@ hostapd_set_bss_options() { append bss_conf "vlan_bridge=$vlan_bridge" "$N" [ -n "$vlan_tagged_interface" ] && \ append bss_conf "vlan_tagged_interface=$vlan_tagged_interface" "$N" + [ -n "$vlan_file" ] && { + [ -e "$vlan_file" ] || touch "$vlan_file" + append bss_conf "vlan_file=$vlan_file" "$N" + } } ;; wep)