mirror of
https://github.com/webmin/webmin.git
synced 2026-02-03 06:03:28 +00:00
More IPv6 function conversions
This commit is contained in:
@@ -158,12 +158,11 @@ else {
|
||||
$rule->{$s} = "me";
|
||||
}
|
||||
else {
|
||||
gethostbyname($in{$s}) ||
|
||||
&check_ipaddress($in{$s}) ||
|
||||
&to_ipaddress($in{$s}) ||
|
||||
($in{$s} =~ /^([0-9\.]+)\/(\d+)$/ &&
|
||||
&check_ipaddress($1)) ||
|
||||
&check_ipaddress("$1")) ||
|
||||
($in{$s} =~ /^([0-9\.]+)\/(\d+)\{([0-9,]+)\}$/ &&
|
||||
&check_ipaddress($1) &&
|
||||
&check_ipaddress("$1") &&
|
||||
$ipfw_version >= 2) ||
|
||||
&error($text{'save_e'.$s});
|
||||
$rule->{$s} = $in{$s};
|
||||
|
||||
@@ -119,7 +119,7 @@ else {
|
||||
$conn->{'values'}->{$d} = '%opportunistic';
|
||||
}
|
||||
else {
|
||||
gethostbyname($in{$d}) || &error($text{"save_e${d}"});
|
||||
&to_ipaddress($in{$d}) || &error($text{"save_e${d}"});
|
||||
$conn->{'values'}->{$d} = $in{$d};
|
||||
}
|
||||
|
||||
|
||||
@@ -31,7 +31,8 @@ else {
|
||||
# Set host and port directives
|
||||
@hosts = split(/\s+/, $in{'host'});
|
||||
foreach $h (@hosts) {
|
||||
gethostbyname($h) || &error(&text('server_ehost', $h));
|
||||
&to_ipaddress($h) || &to_ip6address($h) ||
|
||||
&error(&text('server_ehost', $h));
|
||||
}
|
||||
@hosts || &error($text{'server_ehosts'});
|
||||
&save_directive($conf, "host", join(" ", @hosts));
|
||||
|
||||
@@ -35,7 +35,7 @@ elsif ($in{'ips_mode'} == 1) { $sec{'ips'} = [ "-" ]; }
|
||||
elsif ($in{'ips_mode'} == 2) {
|
||||
@ips = split(/\s+/, $in{'ips'});
|
||||
foreach $ip (@ips) {
|
||||
if (!gethostbyname($ip)) {
|
||||
if (!&to_ipaddress($ip)) {
|
||||
&error(&text('save_secret_enoip', $ip));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@ else {
|
||||
$prog->{'enabled'} = $in{'enabled'};
|
||||
$in{'name'} =~ /^\S+$/ || &error($text{'master_ename'});
|
||||
if (!$in{'host_def'}) {
|
||||
gethostbyname($in{'host'}) || &error($text{'master_ehost'});
|
||||
&to_ipaddress($in{'host'}) || &error($text{'master_ehost'});
|
||||
$in{'type'} eq 'inet' || &error($text{'master_einet'});
|
||||
$prog->{'name'} = $in{'host'}.":".$in{'name'};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user