2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-09-06 18:28:16 +00:00

Fix ddns identification of local address

If networks contains a local, but routed address,
still count it as 'internal'.
This commit is contained in:
Jarrod Johnson
2020-03-27 12:28:21 -04:00
parent 6c72a27077
commit 3c343f83d3

View File

@@ -362,19 +362,12 @@ 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;
}
}
if (!xCAT::NetworkUtils->thishostisnot($_)) {
$valid += 1;
}
}
unless ($valid > 0)
{