mirror of
https://github.com/webmin/webmin.git
synced 2026-02-14 19:02:08 +00:00
Copy IP range support into other ip_match function
This commit is contained in:
@@ -1418,6 +1418,19 @@ for(my $i=1; $i<@_; $i++) {
|
||||
}
|
||||
}
|
||||
}
|
||||
elsif ($_[$i] =~ /^(\S+)-(\S+)$/) {
|
||||
# Compare with an IPv4 range (separated by a hyphen -)
|
||||
local ($remote, $min, $max);
|
||||
@low = split(/\./, $1); @high = split(/\./, $2);
|
||||
for($j=0; $j<4; $j++) {
|
||||
$remote += $io[$j] << ((3-$j)*8);
|
||||
$min += $low[$j] << ((3-$j)*8);
|
||||
$max += $high[$j] << ((3-$j)*8);
|
||||
}
|
||||
if ($remote < $min || $remote > $max) {
|
||||
$mismatch = 1;
|
||||
}
|
||||
}
|
||||
elsif ($ip =~ /^\*(\.\S+)$/) {
|
||||
# Compare with hostname regexp
|
||||
$mismatch = 1 if ($hn !~ /$1$/);
|
||||
|
||||
Reference in New Issue
Block a user