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