IPv6 virtualhost support

This commit is contained in:
Jamie Cameron
2010-11-07 11:56:13 -08:00
parent 7ce74a5e6c
commit 27113327f5
3 changed files with 8 additions and 6 deletions

View File

@@ -8,8 +8,8 @@ $conf = &get_config();
&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'});

View File

@@ -172,12 +172,14 @@ for($i=0; defined($type = $in{"allow_type_$i"}); $i++) {
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\.\-]+$/ ||

View File

@@ -25,7 +25,7 @@ else {
&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'});