]> git.ipfire.org Git - people/stevee/ipfire-2.x.git/commitdiff
ovpnmain.cgi: Use new convert_to_cidr_or_mask() function.
authorStefan Schantl <stefan.schantl@ipfire.org>
Sun, 18 Jul 2021 09:29:46 +0000 (11:29 +0200)
committerStefan Schantl <stefan.schantl@ipfire.org>
Sun, 18 Jul 2021 09:29:46 +0000 (11:29 +0200)
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
html/cgi-bin/ovpnmain.cgi

index 7a2833ce61bd5c283ef72112d41fd7e48df96092..73b04c33a3c966652ba1ed586808449d48dc788b 100644 (file)
@@ -298,7 +298,7 @@ sub writeserverconf {
                @temp = split(/\n/,$vpnsettings{'ROUTES_PUSH'});
                foreach (@temp)
                {
-                       @tempovpnsubnet = split("\/",&General::ipcidr2msk($_));
+                       @tempovpnsubnet = split("\/",&Network::convert_to_cidr_or_mask($_, "mask"));
                        print CONF "push \"route " . $tempovpnsubnet[0]. " " .  $tempovpnsubnet[1] . "\"\n";
                }
        }
@@ -864,7 +864,7 @@ if ($cgiparams{'ACTION'} eq $Lang::tr{'save-adv-options'}) {
                                $errormessage = "$tmpip ".$Lang::tr{'ovpn errmsg invalid ip or mask'};
                                goto ADV_ERROR;
                        }
-                       my ($ip, $cidr) = split("\/",&General::ipcidr2msk($tmpip));
+                       my ($ip, $cidr) = split("\/",&Network::convert_to_cidr_or_mask($tmpip, "mask"));
                        
                        if ($ip eq $netsettings{'GREEN_NETADDRESS'} && $cidr eq $netsettings{'GREEN_NETMASK'}) {
                                $errormessage = $Lang::tr{'ovpn errmsg green already pushed'};