diff mbox series

[OpenWrt-Devel] hostapd: announce utf8 encoding of ssid

Message ID 20180628204729.GA6458@Mindship-03
State Changes Requested
Delegated to: John Crispin
Headers show
Series [OpenWrt-Devel] hostapd: announce utf8 encoding of ssid | expand

Commit Message

Jouke Witteveen June 28, 2018, 8:47 p.m. UTC
The SSID will be UTF-8 encoded when set through LuCI. If otherwise set to a
non UTF-8 encoded value, use utf8_ssid=0 to tell hostapd so.

Signed-off-by: Jouke Witteveen <j.witteveen@gmail.com>
---
 package/network/services/hostapd/files/hostapd.sh | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

John Crispin July 2, 2018, 4:58 a.m. UTC | #1
On 28/06/18 22:47, Jouke Witteveen wrote:
> +	set_default utf8_ssid 1

does this not make it use utf8 by default ?
Jouke Witteveen July 2, 2018, 8:08 a.m. UTC | #2
On Mon, Jul 2, 2018 at 6:58 AM John Crispin <john@phrozen.org> wrote:
>
>
>
> On 28/06/18 22:47, Jouke Witteveen wrote:
> > +     set_default utf8_ssid 1
>
> does this not make it use utf8 by default ?

Yes, it does. I argued that it is utf8 anyway, unless we do some
manual tinkering. An SSID set via LuCI is almost guaranteed to be utf8
an encoded string.

In the end, setting the bit or not should me more or less
inconsequential. It is only there to tell the client how to display
the SSID. Most clients seem to assume utf8 encoding anyway, but it
would be good practice to use this bit. Without the bit, the SSID
should really be treated as a meaningless (non human-readable) byte
string.
diff mbox series

Patch

diff --git a/package/network/services/hostapd/files/hostapd.sh b/package/network/services/hostapd/files/hostapd.sh
index 7ffff4e7e1..b5472ace1b 100644
--- a/package/network/services/hostapd/files/hostapd.sh
+++ b/package/network/services/hostapd/files/hostapd.sh
@@ -227,7 +227,7 @@  hostapd_set_bss_options() {
 		maxassoc max_inactivity disassoc_low_ack isolate auth_cache \
 		wps_pushbutton wps_label ext_registrar wps_pbc_in_m1 wps_ap_setup_locked \
 		wps_independent wps_device_type wps_device_name wps_manufacturer wps_pin \
-		macfilter ssid wmm uapsd hidden short_preamble rsn_preauth \
+		macfilter ssid utf8_ssid wmm uapsd hidden short_preamble rsn_preauth \
 		iapp_interface eapol_version dynamic_vlan ieee80211w nasid \
 		acct_server acct_secret acct_port acct_interval \
 		bss_load_update_period chan_util_avg_period
@@ -237,6 +237,7 @@  hostapd_set_bss_options() {
 	set_default max_inactivity 0
 	set_default short_preamble 1
 	set_default disassoc_low_ack 1
+	set_default utf8_ssid 1
 	set_default hidden 0
 	set_default wmm 1
 	set_default uapsd 1
@@ -395,6 +396,7 @@  hostapd_set_bss_options() {
 	}
 
 	append bss_conf "ssid=$ssid" "$N"
+	append bss_conf "utf8_ssid=$utf8_ssid" "$N"
 	[ -n "$network_bridge" ] && append bss_conf "bridge=$network_bridge" "$N"
 	[ -n "$iapp_interface" ] && {
 		local ifname