On 03/03/2014 12:29 PM, Vittorio G (VittGam) wrote:
> Hi Joseph,
> 
> Thank you for the patch! But there is an error here:
> 
> On Mar 3, 2014 5:59 PM, "Joseph CG Walker"
> <joe+open...@chubbypenguin.net <mailto:joe%2bopen...@chubbypenguin.net>>
> wrote:
> 
>> +define Package/hostpad-common/conffiles
>> +/etc/config/hostpad.vlan
>> +endef
> 
> Hostpad instead of hostapd. ;)
> 
> Regards,
> Vittorio G
> 
> 
> 
> _______________________________________________
> openwrt-devel mailing list
> openwrt-devel@lists.openwrt.org
> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
> 

Here is the correction.

As this is my first contribution to an open source project, is it customary to 
send these corrections to the package maintainer as well, or just to the devel 
list?

Also, I have a patch almost ready to add these options the LuCI web interface.  
Should I re-work it to be used with quilt and submit it here, submit it as a 
ticket to the LuCI project, or some combination / alternative?

Thanks,
 Joe

Signed-off-by: Joseph CG Walker <Joe at ChubbyPenguin.net>

diff --git a/package/network/services/hostapd/Makefile 
b/package/network/services/hostapd/Makefile
index 7070afd..1f8dbd9 100644
--- a/package/network/services/hostapd/Makefile
+++ b/package/network/services/hostapd/Makefile
@@ -320,9 +320,16 @@ define Install/supplicant
        $(INSTALL_DIR) $(1)/usr/sbin
 endef
 
+define Package/hostapd-common/conffiles
+/etc/config/hostapd.vlan
+endef
+
+
 define Package/hostapd-common/install
        $(INSTALL_DIR) $(1)/lib/netifd
        $(INSTALL_DATA) ./files/netifd.sh $(1)/lib/netifd/hostapd.sh
+       $(INSTALL_DIR) $(1)/etc/config
+       $(INSTALL_CONF) ./files/hostapd.vlan $(1)/etc/config/hostapd.vlan
 endef
 
 define Package/hostapd-common-old/install
diff --git a/package/network/services/hostapd/files/hostapd.vlan 
b/package/network/services/hostapd/files/hostapd.vlan
new file mode 100644
index 0000000..facd56b
--- /dev/null
+++ b/package/network/services/hostapd/files/hostapd.vlan
@@ -0,0 +1 @@
+*      wlan0.#
diff --git a/package/network/services/hostapd/files/netifd.sh 
b/package/network/services/hostapd/files/netifd.sh
index f06b2ac..e1d8978 100644
--- a/package/network/services/hostapd/files/netifd.sh
+++ b/package/network/services/hostapd/files/netifd.sh
@@ -118,6 +118,9 @@ hostapd_common_add_bss_config() {
        config_add_string iapp_interface
        config_add_string eap_type ca_cert client_cert identity auth priv_key 
priv_key_pwd
 
+       config_add_int dynamic_vlan vlan_naming
+       config_add_string vlan_tagged_interface vlan_file
+
        config_add_string 'key1:wepkey' 'key2:wepkey' 'key3:wepkey' 
'key4:wepkey' 'password:wpakey'
 
        config_add_boolean wps_pushbutton wps_label ext_registrar
@@ -204,7 +207,8 @@ hostapd_set_bss_options() {
                                acct_server acct_secret acct_port \
                                dae_client dae_secret dae_port \
                                nasid rsn_preauth iapp_interface \
-                               eap_reauth_period
+                               eap_reauth_period dynamic_vlan \
+                               vlan_file vlan_tagged_interface
 
                        # legacy compatibility
                        [ -n "$auth_server" ] || json_get_var auth_server server
@@ -215,6 +219,9 @@ hostapd_set_bss_options() {
                        set_default acct_port 1813
                        set_default dae_port 3799
 
+                       set_default vlan_file "/etc/config/hostapd.vlan"
+                       set_default vlan_naming "1"
+
                        append bss_conf "auth_server_addr=$auth_server" "$N"
                        append bss_conf "auth_server_port=$auth_port" "$N"
                        append bss_conf 
"auth_server_shared_secret=$auth_secret" "$N"
@@ -237,6 +244,15 @@ hostapd_set_bss_options() {
                        append bss_conf "eapol_key_index_workaround=1" "$N"
                        append bss_conf "ieee8021x=1" "$N"
                        append bss_conf "wpa_key_mgmt=WPA-EAP" "$N"
+
+                       [ -n "$dynamic_vlan" ] && {
+                               append bss_conf "dynamic_vlan=$dynamic_vlan" 
"$N"
+                               append bss_conf "vlan_file=$vlan_file" "$N"
+                               append bss_conf "vlan_naming=$vlan_naming" "$N"
+                               [ -n "$vlan_tagged_interface" ] && \
+                                       append bss_conf 
"vlan_tagged_interface=$vlan_tagged_interface" "$N"
+                               
+                       }
                ;;
                wep)
                        local wep_keyidx=0
_______________________________________________
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

Reply via email to