routing.cgi: Allow adding static routes with subnet masks.

It was not possible to enter networks in the subnet mask notation,
which is fixed by this patch.

Fixes #10219.
This commit is contained in:
Michael Tremer
2012-12-11 12:16:54 +01:00
parent 1d0fcb09ed
commit ff1ed674e0
2 changed files with 4 additions and 1 deletions

View File

@@ -118,6 +118,8 @@ if ($settings{'ACTION'} eq $Lang::tr{'toggle enable disable'}) {
}
if ($settings{'ACTION'} eq $Lang::tr{'add'}) {
# Convert subnet masks to CIDR notation.
$settings{'IP'} = &General::iporsubtocidr($settings{'IP'});
# Validate inputs
if (( !&General::validip($settings{'IP'})) and ( !&General::validipandmask($settings{'IP'}))){
@@ -443,4 +445,4 @@ sub SortDataFile
#
sub BuildConfiguration {
system '/usr/local/bin/rebuildroutes';
}
}