X-Git-Url: http://git.archive.openwrt.org/?p=project%2Fnetifd.git;a=blobdiff_plain;f=scripts%2Fnetifd-wireless.sh;h=87d13cac3ef7542bc51076dcc6187cf33a21ac6e;hp=3cb55a390b6656217bdd6ad50038ab195b79478f;hb=4789adf1e55cf51a8b556fba0c7c31bb5f430c7d;hpb=57bf943634acbdeaa41a0a67443e41627cc9c747 diff --git a/scripts/netifd-wireless.sh b/scripts/netifd-wireless.sh index 3cb55a3..87d13ca 100644 --- a/scripts/netifd-wireless.sh +++ b/scripts/netifd-wireless.sh @@ -195,15 +195,15 @@ wireless_vif_parse_encryption() { auth_mode_open=1 auth_mode_shared=0 auth_type=none - wpa_pairwise=CCMP + wpa_cipher=CCMP case "$encryption" in - *tkip+aes|*tkip+ccmp|*aes+tkip|*ccmp+tkip) wpa_pairwise="CCMP TKIP";; - *aes|*ccmp) wpa_pairwise="CCMP";; - *tkip) wpa_pairwise="TKIP";; + *tkip+aes|*tkip+ccmp|*aes+tkip|*ccmp+tkip) wpa_cipher="CCMP TKIP";; + *aes|*ccmp) wpa_cipher="CCMP";; + *tkip) wpa_cipher="TKIP";; esac # 802.11n requires CCMP for WPA - [ "$enable_ht:$wpa_pairwise" = "1:TKIP" ] && wpa_pairwise="CCMP TKIP" + [ "$enable_ht:$wpa_cipher" = "1:TKIP" ] && wpa_cipher="CCMP TKIP" # Examples: # psk-mixed/tkip => WPA1+2 PSK, TKIP @@ -222,9 +222,10 @@ wireless_vif_parse_encryption() { ;; *) wpa=0 - wpa_pairwise= + wpa_cipher= ;; esac + wpa_pairwise="$wpa_cipher" case "$encryption" in *psk*) @@ -248,12 +249,14 @@ wireless_vif_parse_encryption() { esac } -_get_vif_vars() { - # internal use - json_get_var _w_type mode +_wireless_set_brsnoop_isolation() { + local multicast_to_unicast="$1" + local isolate - # for drivers - json_get_var network_bridge bridge + json_get_var isolate isolate + + [ ${isolate:-0} -gt 0 -o -z "$network_bridge" ] && return + [ ${multicast_to_unicast:-1} -gt 0 ] && json_add_boolean isolate 1 } for_each_interface() { @@ -262,13 +265,18 @@ for_each_interface() { local _w_type local _w_found + local multicast_to_unicast + json_get_keys _w_ifaces interfaces json_select interfaces for _w_iface in $_w_ifaces; do json_select "$_w_iface" if [ -n "$_w_types" ]; then + json_get_var network_bridge bridge + json_get_var multicast_to_unicast multicast_to_unicast json_select config - _get_vif_vars + _wireless_set_brsnoop_isolation "$multicast_to_unicast" + json_get_var _w_type mode json_select .. _w_types=" $_w_types " [[ "${_w_types%$_w_type*}" = "$_w_types" ]] && { @@ -287,7 +295,7 @@ _wdev_common_device_config() { } _wdev_common_iface_config() { - config_add_string mode ssid encryption key + config_add_string mode ssid encryption 'key:wpakey' } init_wireless_driver() {