diff options
author | Felix Fietkau <nbd@nbd.name> | 2023-08-29 14:32:42 +0200 |
---|---|---|
committer | Felix Fietkau <nbd@nbd.name> | 2023-09-18 16:52:25 +0200 |
commit | 9720b094aef89802327683f25824820581fed0b9 (patch) | |
tree | 1add9555f456586bf676dca47ac674887d6f7cc2 /package/network/services/hostapd/files/hostapd.sh | |
parent | 263583dc1e569fae3f8e99d73f2fd72376421b17 (diff) | |
download | upstream-9720b094aef89802327683f25824820581fed0b9.tar.gz upstream-9720b094aef89802327683f25824820581fed0b9.tar.bz2 upstream-9720b094aef89802327683f25824820581fed0b9.zip |
hostapd: backport from master, including ucode based reload support
This significantly improves config reload behavior and also fixes some
corner cases related to running AP + mesh interfaces at the same time.
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Diffstat (limited to 'package/network/services/hostapd/files/hostapd.sh')
-rw-r--r-- | package/network/services/hostapd/files/hostapd.sh | 38 |
1 files changed, 8 insertions, 30 deletions
diff --git a/package/network/services/hostapd/files/hostapd.sh b/package/network/services/hostapd/files/hostapd.sh index 28bd210623..c6ae6fb98b 100644 --- a/package/network/services/hostapd/files/hostapd.sh +++ b/package/network/services/hostapd/files/hostapd.sh @@ -121,6 +121,7 @@ hostapd_common_add_device_config() { config_add_array hostapd_options config_add_int airtime_mode + config_add_int mbssid hostapd_add_log_config } @@ -133,7 +134,8 @@ hostapd_prepare_device_config() { json_get_vars country country3 country_ie beacon_int:100 doth require_mode legacy_rates \ acs_chan_bias local_pwr_constraint spectrum_mgmt_required airtime_mode cell_density \ - rts_threshold beacon_rate rssi_reject_assoc_rssi rssi_ignore_probe_request maxassoc + rts_threshold beacon_rate rssi_reject_assoc_rssi rssi_ignore_probe_request maxassoc \ + mbssid:0 hostapd_set_log_options base_cfg @@ -234,6 +236,7 @@ hostapd_prepare_device_config() { [ -n "$rts_threshold" ] && append base_cfg "rts_threshold=$rts_threshold" "$N" [ "$airtime_mode" -gt 0 ] && append base_cfg "airtime_mode=$airtime_mode" "$N" [ -n "$maxassoc" ] && append base_cfg "iface_max_num_sta=$maxassoc" "$N" + [ "$mbssid" -gt 0 ] && [ "$mbssid" -le 2 ] && append base_cfg "mbssid=$mbssid" "$N" json_get_values opts hostapd_options for val in $opts; do @@ -625,8 +628,7 @@ hostapd_set_bss_options() { [ -n "$wpa_strict_rekey" ] && append bss_conf "wpa_strict_rekey=$wpa_strict_rekey" "$N" } - set_default nasid "${macaddr//\:}" - append bss_conf "nas_identifier=$nasid" "$N" + [ -n "$nasid" ] && append bss_conf "nas_identifier=$nasid" "$N" [ -n "$acct_interval" ] && \ append bss_conf "radius_acct_interim_interval=$acct_interval" "$N" @@ -864,8 +866,9 @@ hostapd_set_bss_options() { [ "$bss_transition" -eq "1" ] && append bss_conf "bss_transition=1" "$N" [ "$mbo" -eq 1 ] && append bss_conf "mbo=1" "$N" - json_get_vars ieee80211k rrm_neighbor_report rrm_beacon_report + json_get_vars ieee80211k rrm_neighbor_report rrm_beacon_report rnr set_default ieee80211k 0 + set_default rnr 0 if [ "$ieee80211k" -eq "1" ]; then set_default rrm_neighbor_report 1 set_default rrm_beacon_report 1 @@ -876,6 +879,7 @@ hostapd_set_bss_options() { [ "$rrm_neighbor_report" -eq "1" ] && append bss_conf "rrm_neighbor_report=1" "$N" [ "$rrm_beacon_report" -eq "1" ] && append bss_conf "rrm_beacon_report=1" "$N" + [ "$rnr" -eq "1" ] && append bss_conf "rnr=1" "$N" json_get_vars ftm_responder stationary_ap lci civic set_default ftm_responder 0 @@ -1156,9 +1160,6 @@ hostapd_set_bss_options() { append bss_conf "$val" "$N" done - bss_md5sum="$(echo $bss_conf | md5sum | cut -d" " -f1)" - append bss_conf "config_id=$bss_md5sum" "$N" - append "$var" "$bss_conf" "$N" return 0 } @@ -1588,29 +1589,6 @@ EOF return 0 } -wpa_supplicant_run() { - local ifname="$1" - local hostapd_ctrl="$2" - - _wpa_supplicant_common "$ifname" - - ubus wait_for wpa_supplicant - local supplicant_res="$(ubus call wpa_supplicant config_add "{ \ - \"driver\": \"${_w_driver:-wext}\", \"ctrl\": \"$_rpath\", \ - \"iface\": \"$ifname\", \"config\": \"$_config\" \ - ${network_bridge:+, \"bridge\": \"$network_bridge\"} \ - ${hostapd_ctrl:+, \"hostapd_ctrl\": \"$hostapd_ctrl\"} \ - }")" - - ret="$?" - - [ "$ret" != 0 -o -z "$supplicant_res" ] && wireless_setup_vif_failed WPA_SUPPLICANT_FAILED - - wireless_add_process "$(jsonfilter -s "$supplicant_res" -l 1 -e @.pid)" "/usr/sbin/wpa_supplicant" 1 1 - - return $ret -} - hostapd_common_cleanup() { killall meshd-nl80211 } |