mirror of
https://github.com/webmin/webmin.git
synced 2026-02-03 14:13:29 +00:00
IPv6 virtualhost support
This commit is contained in:
@@ -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'});
|
||||
|
||||
@@ -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\.\-]+$/ ||
|
||||
|
||||
@@ -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'});
|
||||
|
||||
Reference in New Issue
Block a user