diff mbox

[OpenWrt-Devel,2/3] authsae: Use kbit/s as mcast_rate unit like wpad

Message ID 1448378243-1021-2-git-send-email-sven@open-mesh.com
State Superseded
Headers show

Commit Message

Sven Eckelmann Nov. 24, 2015, 3:17 p.m. UTC
The OpenWrt wireless configuration for mcast_rate is defined as Kbit/s when
using wpa_supplicant for IBSS/802.11s and iw for unencrypted IBSS/802.11s.
But when using authsae, the unit for the same option is redefined as
Mbit/s.

Better always use the same unit for this option and don't make it backend
specific.

Signed-off-by: Sven Eckelmann <sven@open-mesh.com>
---
 package/network/services/authsae/files/lib/wifi/authsae.sh | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

Comments

John Crispin Nov. 24, 2015, 4:46 p.m. UTC | #1
On 24/11/2015 16:17, Sven Eckelmann wrote:
> The OpenWrt wireless configuration for mcast_rate is defined as
> Kbit/s when using wpa_supplicant for IBSS/802.11s and iw for
> unencrypted IBSS/802.11s. But when using authsae, the unit for the
> same option is redefined as Mbit/s.

making stuff consistent is always nice BUT ...

> 
> Better always use the same unit for this option and don't make it
> backend specific.
> 
> Signed-off-by: Sven Eckelmann <sven@open-mesh.com> --- 
> package/network/services/authsae/files/lib/wifi/authsae.sh | 7
> +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git
> a/package/network/services/authsae/files/lib/wifi/authsae.sh
> b/package/network/services/authsae/files/lib/wifi/authsae.sh index
> 6582a35..ce5f32d 100644 ---
> a/package/network/services/authsae/files/lib/wifi/authsae.sh +++
> b/package/network/services/authsae/files/lib/wifi/authsae.sh @@
> -6,7 +6,7 @@ authsae_start_interface() { local ret=1
> 
> json_get_vars mcast_rate mesh_id -	set_default mcast_rate "12" +
> set_default mcast_rate "12000"
> 
> case "$htmode" in HT20|HT40+|HT40-) mesh_htmode="$htmode";; @@
> -18,6 +18,9 @@ authsae_start_interface() { *a*) mesh_band=11a;; 
> esac
> 
> +	# authsae only supports integer as mcast-rate and not things like
> 5.5 +	mcval=$(($mcast_rate / 1000)) +

this will break existing uci setups on a sysupgrade i would assume.
you could avoid breakage by only dividing the mcast_rate if it is
higher > 1000.

	John

> cat > "$authsae_conf_file" <<EOF authsae: { @@ -40,7 +43,7 @@
> authsae: band = "$mesh_band"; channel = $channel; htmode =
> "$mesh_htmode"; -    mcast-rate = $mcast_rate; +    mcast-rate =
> $mcval; }; }; EOF
>
Sven Eckelmann Nov. 24, 2015, 4:49 p.m. UTC | #2
On Tuesday 24 November 2015 17:46:56 John Crispin wrote:
> 
> On 24/11/2015 16:17, Sven Eckelmann wrote:
> > The OpenWrt wireless configuration for mcast_rate is defined as
> > Kbit/s when using wpa_supplicant for IBSS/802.11s and iw for
> > unencrypted IBSS/802.11s. But when using authsae, the unit for the
> > same option is redefined as Mbit/s.
> 
> making stuff consistent is always nice BUT ...
> 
[...]
> this will break existing uci setups on a sysupgrade i would assume.
> you could avoid breakage by only dividing the mcast_rate if it is
> higher > 1000.

Ok. I will later resubmit this patch (but not the rest).

Kind regards,
	Sven
diff mbox

Patch

diff --git a/package/network/services/authsae/files/lib/wifi/authsae.sh b/package/network/services/authsae/files/lib/wifi/authsae.sh
index 6582a35..ce5f32d 100644
--- a/package/network/services/authsae/files/lib/wifi/authsae.sh
+++ b/package/network/services/authsae/files/lib/wifi/authsae.sh
@@ -6,7 +6,7 @@  authsae_start_interface() {
 	local ret=1
 
 	json_get_vars mcast_rate mesh_id
-	set_default mcast_rate "12"
+	set_default mcast_rate "12000"
 
 	case "$htmode" in
 		HT20|HT40+|HT40-) mesh_htmode="$htmode";;
@@ -18,6 +18,9 @@  authsae_start_interface() {
 		*a*) mesh_band=11a;;
 	esac
 
+	# authsae only supports integer as mcast-rate and not things like 5.5
+	mcval=$(($mcast_rate / 1000))
+
 	cat > "$authsae_conf_file" <<EOF
 authsae:
 {
@@ -40,7 +43,7 @@  authsae:
     band = "$mesh_band";
     channel = $channel;
     htmode = "$mesh_htmode";
-    mcast-rate = $mcast_rate;
+    mcast-rate = $mcval;
   };
 };
 EOF