From 5aa2ddd0d6b9759c62bbb7bb11b72a7f4269c16b Mon Sep 17 00:00:00 2001 From: John Crispin Date: Mon, 25 May 2020 11:39:40 +0200 Subject: 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 --- package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'package/kernel/mac80211/files/lib') diff --git a/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh b/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh index be637379e3..4171af2f60 100644 --- a/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh +++ b/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh @@ -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 -- cgit v1.2.3