&error_setup($text{'vserv_err'});
# Validate inputs
-$in{'addr_def'} || gethostbyname($in{'addr'}) ||
- &check_ipaddress($in{'addr'}) ||
+$in{'addr_def'} || &to_ipaddress($in{'addr'}) ||
+ &to_ip6address($in{'addr'}) ||
&error($text{'vserv_eaddr'});
$in{'Port_def'} || $in{'Port'} =~ /^\d+$/ ||
&error($text{'vserv_eport'});
if ($mode == 0) { $what = "all"; }
elsif ($mode == 1) { $what = "none"; }
elsif ($mode == 2) {
- &check_ipaddress($what) || &error(&text('mod_core_eip', $what));
+ &check_ipaddress($what) || &check_ip6address($what) ||
+ &error(&text('mod_core_eip', $what));
}
elsif ($mode == 3) {
$what =~ /^[0-9\.]+\.$/ ||
- $what =~ /^([0-9\.]+)\/\d+$/ && &check_ipaddress($1) ||
- &error(&text('mod_core_enet', $what));
+ $what =~ /^([0-9\.]+)\/\d+$/ && &check_ipaddress("$1") ||
+ $what =~ /^([a-f0-9:]+)\/\d+$/ && &check_ip6address("$1") ||
+ &error(&text('mod_core_enet', $what));
}
elsif ($mode == 4) {
$what =~ /^[A-Za-z0-9\.\-]+$/ ||
&error_setup($text{'vserv_err'});
# Check inputs
- gethostbyname($in{'addr'}) || &to_ipaddress($in{'addr'}) ||
+ &to_ipaddress($in{'addr'}) || &to_ip6address($in{'addr'}) ||
&error($text{'vserv_eaddr'});
$in{'Port_def'} || $in{'Port'} =~ /^\d+$/ ||
&error($text{'vserv_eport'});