hostapd: make client isolation configurable via WebUI
Commit Message
hostapd supports client-isolation, but this feature could
not be configured via the WebUI so far. Since it might be
desired in public wireless networks, or even private ones,
it makes sense to provide a radio button to let the user
decide on.
Fixes #11974.
Signed-off-by: Peter Müller <peter.mueller@ipfire.org>
---
html/cgi-bin/wlanap.cgi | 14 ++++++++++++++
1 file changed, 14 insertions(+)
Comments
Hi,
I guess this looks okay.
The file has no translation it seems.
Will you also build this for IPFire 3?
-Michael
> On 16 Mar 2019, at 14:20, Peter Müller <peter.mueller@ipfire.org> wrote:
>
> hostapd supports client-isolation, but this feature could
> not be configured via the WebUI so far. Since it might be
> desired in public wireless networks, or even private ones,
> it makes sense to provide a radio button to let the user
> decide on.
>
> Fixes #11974.
>
> Signed-off-by: Peter Müller <peter.mueller@ipfire.org>
> ---
> html/cgi-bin/wlanap.cgi | 14 ++++++++++++++
> 1 file changed, 14 insertions(+)
>
> diff --git a/html/cgi-bin/wlanap.cgi b/html/cgi-bin/wlanap.cgi
> index 72c9a1298..cae191101 100644
> --- a/html/cgi-bin/wlanap.cgi
> +++ b/html/cgi-bin/wlanap.cgi
> @@ -75,6 +75,7 @@ $wlanapsettings{'DRIVER'} = 'NL80211';
> $wlanapsettings{'HTCAPS'} = '';
> $wlanapsettings{'VHTCAPS'} = '';
> $wlanapsettings{'NOSCAN'} = 'off';
> +$wlanapsettings{'CLIENTISOLATION'} = 'off';
>
> &General::readhash("/var/ipfire/wlanap/settings", \%wlanapsettings);
> &Header::getcgihash(\%wlanapsettings);
> @@ -252,6 +253,10 @@ $checked{'NOSCAN'}{'off'} = '';
> $checked{'NOSCAN'}{'on'} = '';
> $checked{'NOSCAN'}{$wlanapsettings{'NOSCAN'}} = "checked='checked'";
>
> +$checked{'CLIENTISOLATION'}{'off'} = '';
> +$checked{'CLIENTISOLATION'}{'on'} = '';
> +$checked{'CLIENTISOLATION'}{$wlanapsettings{'CLIENTISOLATION'}} = "checked='checked'";
> +
> $selected{'ENC'}{$wlanapsettings{'ENC'}} = "selected='selected'";
> $selected{'CHANNEL'}{$wlanapsettings{'CHANNEL'}} = "selected='selected'";
> $selected{'COUNTRY'}{$wlanapsettings{'COUNTRY'}} = "selected='selected'";
> @@ -377,6 +382,7 @@ print <<END
> <tr><td width='25%' class='base'>SSID: </td><td class='base' colspan='3'><input type='text' name='SSID' size='30' value='$wlanapsettings{'SSID'}' /></td></tr>
> <!--SSID Broadcast: on => HIDESSID: off -->
> <tr><td width='25%' class='base'>SSID Broadcast: </td><td class='base' colspan='3'>on <input type='radio' name='HIDESSID' value='off' $checked{'HIDESSID'}{'off'} /> | <input type='radio' name='HIDESSID' value='on' $checked{'HIDESSID'}{'on'} /> off</td></tr>
> +<tr><td width='25%' class='base'>Client Isolation: </td><td class='base' colspan='3'>on <input type='radio' name='CLIENTISOLATION' value='off' $checked{'CLIENTISOLATION'}{'off'} /> | <input type='radio' name='CLIENTISOLATION' value='on' $checked{'CLIENTISOLATION'}{'on'} /> off</td></tr>
>
>
> <tr><td width='25%' class='base'>$Lang::tr{'wlanap country'}: </td><td class='base' colspan='3'>
> @@ -632,6 +638,14 @@ END
>
> }
>
> + # https://forum.ipfire.org/viewtopic.php?f=22&t=12274&p=79070#p79070
I do not get how this comment is helpful.
> + if ( $wlanapsettings{'CLIENTISOLATION'} eq 'on' ){
> + print CONFIGFILE <<END
> +ap_isolate=1
> +END
> +;
> + }
> +
> if ( $wlanapsettings{'NOSCAN'} eq 'on' ){
> print CONFIGFILE <<END
> noscan=1
> --
> 2.16.4
@@ -75,6 +75,7 @@ $wlanapsettings{'DRIVER'} = 'NL80211';
$wlanapsettings{'HTCAPS'} = '';
$wlanapsettings{'VHTCAPS'} = '';
$wlanapsettings{'NOSCAN'} = 'off';
+$wlanapsettings{'CLIENTISOLATION'} = 'off';
&General::readhash("/var/ipfire/wlanap/settings", \%wlanapsettings);
&Header::getcgihash(\%wlanapsettings);
@@ -252,6 +253,10 @@ $checked{'NOSCAN'}{'off'} = '';
$checked{'NOSCAN'}{'on'} = '';
$checked{'NOSCAN'}{$wlanapsettings{'NOSCAN'}} = "checked='checked'";
+$checked{'CLIENTISOLATION'}{'off'} = '';
+$checked{'CLIENTISOLATION'}{'on'} = '';
+$checked{'CLIENTISOLATION'}{$wlanapsettings{'CLIENTISOLATION'}} = "checked='checked'";
+
$selected{'ENC'}{$wlanapsettings{'ENC'}} = "selected='selected'";
$selected{'CHANNEL'}{$wlanapsettings{'CHANNEL'}} = "selected='selected'";
$selected{'COUNTRY'}{$wlanapsettings{'COUNTRY'}} = "selected='selected'";
@@ -377,6 +382,7 @@ print <<END
<tr><td width='25%' class='base'>SSID: </td><td class='base' colspan='3'><input type='text' name='SSID' size='30' value='$wlanapsettings{'SSID'}' /></td></tr>
<!--SSID Broadcast: on => HIDESSID: off -->
<tr><td width='25%' class='base'>SSID Broadcast: </td><td class='base' colspan='3'>on <input type='radio' name='HIDESSID' value='off' $checked{'HIDESSID'}{'off'} /> | <input type='radio' name='HIDESSID' value='on' $checked{'HIDESSID'}{'on'} /> off</td></tr>
+<tr><td width='25%' class='base'>Client Isolation: </td><td class='base' colspan='3'>on <input type='radio' name='CLIENTISOLATION' value='off' $checked{'CLIENTISOLATION'}{'off'} /> | <input type='radio' name='CLIENTISOLATION' value='on' $checked{'CLIENTISOLATION'}{'on'} /> off</td></tr>
<tr><td width='25%' class='base'>$Lang::tr{'wlanap country'}: </td><td class='base' colspan='3'>
@@ -632,6 +638,14 @@ END
}
+ # https://forum.ipfire.org/viewtopic.php?f=22&t=12274&p=79070#p79070
+ if ( $wlanapsettings{'CLIENTISOLATION'} eq 'on' ){
+ print CONFIGFILE <<END
+ap_isolate=1
+END
+;
+ }
+
if ( $wlanapsettings{'NOSCAN'} eq 'on' ){
print CONFIGFILE <<END
noscan=1