INotify::read_etc_resolv_conf: ipv6 support

This commit is contained in:
Wolfgang Bumiller 2015-10-05 09:30:56 +02:00 committed by Dietmar Maurer
parent 027e1e4e39
commit 176b1186bd
2 changed files with 3 additions and 1 deletions

View File

@ -540,7 +540,7 @@ sub read_etc_resolv_conf {
chomp $line;
if ($line =~ m/^(search|domain)\s+(\S+)\s*/) {
$res->{search} = $2;
} elsif ($line =~ m/^nameserver\s+(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})\s*/) {
} elsif ($line =~ m/^\s*nameserver\s+($PVE::Tools::IPRE)\s*/) {
$nscount++;
if ($nscount <= 3) {
$res->{"dns$nscount"} = $1;

View File

@ -63,6 +63,8 @@ our $IPV6RE = "(?:" .
"(?:(?:(?:(?:$IPV6H16:){0,5}$IPV6H16)?::" . ")$IPV6H16)|" .
"(?:(?:(?:(?:$IPV6H16:){0,6}$IPV6H16)?::" . ")))";
our $IPRE = "(?:$IPV4RE|$IPV6RE)";
use constant (CLONE_NEWNS => 0x00020000,
CLONE_NEWUTS => 0x04000000,
CLONE_NEWIPC => 0x08000000,