hostapd: add support for wifi-station and wifi-vlan sections

This patch adds support for 2 new uci sections.

config wifi-vlan
	# iface is optional. if it is not defined the vlan will apply
	# to all interfaces
        option iface	default_radio0
        option name	guest
        option vid	100
        option network	guest

config wifi-station
	# iface is optional. if it is not defined the station will apply
	# to all interfaces
        option iface	default_radio0
        # mac is optional. if it is not defined it will be a catch all
	# for any sta using this key
	option mac	'00:11:22:33:44:55'
        # vid is optional. if it is not defined, the sta will be part of
	# the primary iface.
	option vid	100
        option key	testtest

With this patch applied it is possible to use multiple PSKs on a single BSS.

Signed-off-by: John Crispin <john@phrozen.org>
This commit is contained in:
John Crispin
2020-05-25 11:39:40 +02:00
parent 303b463394
commit 5aa2ddd0d6
2 changed files with 44 additions and 1 deletions

View File

@@ -506,7 +506,7 @@ mac80211_iw_interface_add() {
mac80211_prepare_vif() {
json_select config
json_get_vars ifname mode ssid wds powersave macaddr enable
json_get_vars ifname mode ssid wds powersave macaddr enable wpa_psk_file vlan_file
[ -n "$ifname" ] || ifname="wlan${phy#phy}${if_idx:+-$if_idx}"
if_idx=$((${if_idx:-0} + 1))
@@ -524,6 +524,12 @@ mac80211_prepare_vif() {
json_add_object data
json_add_string ifname "$ifname"
json_close_object
[ "$mode" == "ap" ] && {
[ -z "$wpa_psk_file" ] && hostapd_set_psk "$ifname"
[ -z "$vlan_file" ] && hostapd_set_vlan "$ifname"
}
json_select config
# It is far easier to delete and create the desired interface