vpnmain.cgi: Set MTU to a default when editing an old connection
authorMichael Tremer <michael.tremer@ipfire.org>
Thu, 4 Apr 2019 10:52:30 +0000 (11:52 +0100)
committerMichael Tremer <michael.tremer@ipfire.org>
Thu, 4 Apr 2019 10:53:11 +0000 (11:53 +0100)
This field is required and therefore we need to initialize it
for old connections. Right now, the CGI throws an error message
when editing an existing connection without the MTU being filled
in.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
config/rootfiles/core/130/filelists/files
html/cgi-bin/vpnmain.cgi

index ab1e82f..248a2c7 100644 (file)
@@ -14,6 +14,7 @@ srv/web/ipfire/cgi-bin/ids.cgi
 srv/web/ipfire/cgi-bin/logs.cgi/ids.dat
 srv/web/ipfire/cgi-bin/logs.cgi/log.dat
 srv/web/ipfire/cgi-bin/ovpnmain.cgi
+srv/web/ipfire/cgi-bin/vpnmain.cgi
 usr/local/bin/ipsec-interfaces
 usr/local/bin/suricatactrl
 usr/local/bin/update-ids-ruleset
index 00282d5..ecf860d 100644 (file)
@@ -1363,6 +1363,10 @@ END
                        $cgiparams{'MODE'} = "tunnel";
                }
 
+               if ($cgiparams{'INTERFACE_MTU'} eq "") {
+                       $cgiparams{'INTERFACE_MTU'} = 1500;
+               }
+
        } elsif ($cgiparams{'ACTION'} eq $Lang::tr{'save'}) {
                $cgiparams{'REMARK'} = &Header::cleanhtml($cgiparams{'REMARK'});
                if ($cgiparams{'TYPE'} !~ /^(host|net)$/) {