mirror of
https://github.com/xcat2/xcat-core.git
synced 2026-07-31 10:09:40 +00:00
Merge pull request #7633 from VersatusHPC/harvest/ddns-routed-local-address
fix(ddns): recognize a routed local nameserver address
This commit is contained in:
@@ -443,18 +443,17 @@ sub process_request {
|
||||
if ($net and $net->{nameservers})
|
||||
{
|
||||
my $valid = 0;
|
||||
my @myips;
|
||||
my @myipsd = xCAT::NetworkUtils->my_ip_facing($net->{net});
|
||||
my $myipsd_l = @myipsd;
|
||||
unless ($myipsd[0]) { @myips = @myipsd[ 1 .. ($myipsd_l - 1) ]; }
|
||||
foreach (split /,/, $net->{nameservers})
|
||||
{
|
||||
chomp $_;
|
||||
foreach my $myip (@myips) {
|
||||
if (($_ eq $myip) || ($_ eq '<xcatmaster>') || ($_ eq $sitens))
|
||||
{
|
||||
$valid += 1;
|
||||
}
|
||||
# my_ip_facing() only returns addresses on the interface directly
|
||||
# facing this network, so a nameserver that is a local address on
|
||||
# another (routed) interface was wrongly treated as external.
|
||||
# thishostisnot() recognizes any local address; keep the existing
|
||||
# <xcatmaster> and site-nameserver special cases.
|
||||
if (!xCAT::NetworkUtils->thishostisnot($_) || $_ eq '<xcatmaster>' || $_ eq $sitens)
|
||||
{
|
||||
$valid += 1;
|
||||
}
|
||||
}
|
||||
unless ($valid > 0)
|
||||
|
||||
Reference in New Issue
Block a user