From: Michael Tremer Date: Tue, 9 Apr 2024 16:08:06 +0000 (+0200) Subject: ovpnmain.cgi: Move destination port to advanced settings X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=82cf4a93f35fe6f2f1328ecd2cd6c460a58a95de;p=people%2Fms%2Fipfire-2.x.git ovpnmain.cgi: Move destination port to advanced settings Signed-off-by: Michael Tremer --- diff --git a/html/cgi-bin/ovpnmain.cgi b/html/cgi-bin/ovpnmain.cgi index 1596c2b3b..12aff9046 100755 --- a/html/cgi-bin/ovpnmain.cgi +++ b/html/cgi-bin/ovpnmain.cgi @@ -948,6 +948,7 @@ if ($cgiparams{'ACTION'} eq $Lang::tr{'save-adv-options'}) { #DAN this value has to leave. #new settings for daemon $vpnsettings{'DPROTOCOL'} = $cgiparams{'DPROTOCOL'}; + $vpnsettings{'DDEST_PORT'} = $cgiparams{'DDEST_PORT'}; $vpnsettings{'DMTU'} = $cgiparams{'DMTU'}; $vpnsettings{'LOG_VERB'} = $cgiparams{'LOG_VERB'}; $vpnsettings{'KEEPALIVE_1'} = $cgiparams{'KEEPALIVE_1'}; @@ -983,6 +984,12 @@ if ($cgiparams{'ACTION'} eq $Lang::tr{'save-adv-options'}) { } } + # Check port + unless (&General::validport($cgiparams{'DDEST_PORT'})) { + $errormessage = $Lang::tr{'invalid port'}; + goto ADV_ERROR; + } + # Check MTU if (($cgiparams{'DMTU'} eq "") || (($cgiparams{'DMTU'}) < 1280 )) { $errormessage = $Lang::tr{'invalid mtu input'}; @@ -1364,11 +1371,6 @@ if ($cgiparams{'ACTION'} eq $Lang::tr{'save'} && $cgiparams{'TYPE'} eq '' && $cg goto SETTINGS_ERROR; } - unless (&General::validport($cgiparams{'DDEST_PORT'})) { - $errormessage = $Lang::tr{'invalid port'}; - goto SETTINGS_ERROR; - } - # Create ta.key for tls-auth if not presant if ($cgiparams{'TLSAUTH'} eq 'on') { if ( ! -e "${General::swroot}/ovpn/certs/ta.key") { @@ -1384,7 +1386,6 @@ if ($cgiparams{'ACTION'} eq $Lang::tr{'save'} && $cgiparams{'TYPE'} eq '' && $cg $vpnsettings{'ENABLED'} = $cgiparams{'ENABLED'}; $vpnsettings{'VPN_IP'} = $cgiparams{'VPN_IP'}; $vpnsettings{'DOVPN_SUBNET'} = $cgiparams{'DOVPN_SUBNET'}; - $vpnsettings{'DDEST_PORT'} = $cgiparams{'DDEST_PORT'}; #new settings for daemon &General::writehash("${General::swroot}/ovpn/settings", \%vpnsettings); @@ -2727,6 +2728,9 @@ ADV_ERROR: if ($cgiparams{'DAUTH'} eq '') { $cgiparams{'DAUTH'} = 'SHA512'; } + if ($cgiparams{'DDEST_PORT'} eq '') { + $cgiparams{'DDEST_PORT'} = '1194'; + } if ($cgiparams{'DMTU'} eq '') { $cgiparams{'DMTU'} = '1400'; } @@ -2968,6 +2972,13 @@ END + + $Lang::tr{'destination port'} + + + + + $Lang::tr{'mtu'} @@ -5183,9 +5194,6 @@ END } #default setzen - if ($cgiparams{'DDEST_PORT'} eq '') { - $cgiparams{'DDEST_PORT'} = '1194'; - } if ($cgiparams{'MSSFIX'} eq '') { $cgiparams{'MSSFIX'} = 'off'; } @@ -5252,13 +5260,6 @@ END $Lang::tr{'local vpn hostname/ip'}:
$Lang::tr{'ovpn subnet'}
- $Lang::tr{'protocol'} - - $Lang::tr{'destination port'}: - - - -
END ;