OpenVPN: Fix max-clients option

Message ID 20191104145226.19638-1-ummeegge@ipfire.org
State Accepted
Commit fa5274763c55515dc1a0e519da3582b0fec440b8
Headers
Series OpenVPN: Fix max-clients option |

Commit Message

ummeegge Nov. 4, 2019, 2:52 p.m. UTC
  Fix: Triggered by https://forum.ipfire.org/viewtopic.php?f=16&t=23551

Since the 'DHCP_WINS' cgiparam has been set for the max-client directive, changes in the WUI has not been adapted to server.conf.

Signed-off-by: Erik Kapfer <ummeegge@ipfire.org>
---
 html/cgi-bin/ovpnmain.cgi | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
  

Comments

Michael Tremer Nov. 4, 2019, 4:32 p.m. UTC | #1
Reviewed-by: Michael Tremer <michael.tremer@ipfire.org>

Interesting is how long this has been in here unnoticed.

> On 4 Nov 2019, at 14:52, Erik Kapfer <ummeegge@ipfire.org> wrote:
> 
> Fix: Triggered by https://forum.ipfire.org/viewtopic.php?f=16&t=23551
> 
> Since the 'DHCP_WINS' cgiparam has been set for the max-client directive, changes in the WUI has not been adapted to server.conf.
> 
> Signed-off-by: Erik Kapfer <ummeegge@ipfire.org>
> ---
> html/cgi-bin/ovpnmain.cgi | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/html/cgi-bin/ovpnmain.cgi b/html/cgi-bin/ovpnmain.cgi
> index 970444a55..09f0dc42f 100644
> --- a/html/cgi-bin/ovpnmain.cgi
> +++ b/html/cgi-bin/ovpnmain.cgi
> @@ -355,10 +355,10 @@ sub writeserverconf {
>         print CONF "push \"dhcp-option WINS $sovpnsettings{DHCP_WINS}\"\n";
>     }
> 
> -    if ($sovpnsettings{DHCP_WINS} eq '') {
> +    if ($sovpnsettings{MAX_CLIENTS} eq '') {
> 	print CONF "max-clients 100\n";
>     }
> -    if ($sovpnsettings{DHCP_WINS} ne '') {
> +    if ($sovpnsettings{MAX_CLIENTS} ne '') {
> 	print CONF "max-clients $sovpnsettings{MAX_CLIENTS}\n";
>     }	
>     print CONF "tls-verify /usr/lib/openvpn/verify\n";
> -- 
> 2.12.2
>
  
ummeegge Nov. 4, 2019, 4:46 p.m. UTC | #2
On Mo, 2019-11-04 at 16:32 +0000, Michael Tremer wrote:
> Reviewed-by: Michael Tremer <michael.tremer@ipfire.org>
> 
> Interesting is how long this has been in here unnoticed.
A long time...

> 
> > On 4 Nov 2019, at 14:52, Erik Kapfer <ummeegge@ipfire.org> wrote:
> > 
> > Fix: Triggered by 
> > https://forum.ipfire.org/viewtopic.php?f=16&t=23551
> > 
> > Since the 'DHCP_WINS' cgiparam has been set for the max-client
> > directive, changes in the WUI has not been adapted to server.conf.
> > 
> > Signed-off-by: Erik Kapfer <ummeegge@ipfire.org>
> > ---
> > html/cgi-bin/ovpnmain.cgi | 4 ++--
> > 1 file changed, 2 insertions(+), 2 deletions(-)
> > 
> > diff --git a/html/cgi-bin/ovpnmain.cgi b/html/cgi-bin/ovpnmain.cgi
> > index 970444a55..09f0dc42f 100644
> > --- a/html/cgi-bin/ovpnmain.cgi
> > +++ b/html/cgi-bin/ovpnmain.cgi
> > @@ -355,10 +355,10 @@ sub writeserverconf {
> >         print CONF "push \"dhcp-option WINS
> > $sovpnsettings{DHCP_WINS}\"\n";
> >     }
> > 
> > -    if ($sovpnsettings{DHCP_WINS} eq '') {
> > +    if ($sovpnsettings{MAX_CLIENTS} eq '') {
> > 	print CONF "max-clients 100\n";
> >     }
> > -    if ($sovpnsettings{DHCP_WINS} ne '') {
> > +    if ($sovpnsettings{MAX_CLIENTS} ne '') {
> > 	print CONF "max-clients $sovpnsettings{MAX_CLIENTS}\n";
> >     }	
> >     print CONF "tls-verify /usr/lib/openvpn/verify\n";
> > -- 
> > 2.12.2
> > 
> 
>
  

Patch

diff --git a/html/cgi-bin/ovpnmain.cgi b/html/cgi-bin/ovpnmain.cgi
index 970444a55..09f0dc42f 100644
--- a/html/cgi-bin/ovpnmain.cgi
+++ b/html/cgi-bin/ovpnmain.cgi
@@ -355,10 +355,10 @@  sub writeserverconf {
         print CONF "push \"dhcp-option WINS $sovpnsettings{DHCP_WINS}\"\n";
     }
     
-    if ($sovpnsettings{DHCP_WINS} eq '') {
+    if ($sovpnsettings{MAX_CLIENTS} eq '') {
 	print CONF "max-clients 100\n";
     }
-    if ($sovpnsettings{DHCP_WINS} ne '') {
+    if ($sovpnsettings{MAX_CLIENTS} ne '') {
 	print CONF "max-clients $sovpnsettings{MAX_CLIENTS}\n";
     }	
     print CONF "tls-verify /usr/lib/openvpn/verify\n";