diff --git a/perl-xCAT/xCAT/Utils.pm b/perl-xCAT/xCAT/Utils.pm index 0051afaca..94e6df04c 100644 --- a/perl-xCAT/xCAT/Utils.pm +++ b/perl-xCAT/xCAT/Utils.pm @@ -1952,6 +1952,7 @@ sub nodeonmynet my $noden = unpack("N", inet_aton($nodeip)); my @nets; if ($utildata->{nodeonmynetdata} and $utildata->{nodeonmynetdata}->{pid} == $$) { + @nets = @{$utildata->{nodeonmynetdata}->{nets}}; } else { @nets = split /\n/, `/sbin/ip route`; my $nettab=xCAT::Table->new("networks"); @@ -1964,11 +1965,12 @@ sub nodeonmynet $bits--; $curm=$curm>>1; } - push @nets,$_->{'net'}."/".$bits." remote"; + push @nets,$_->{'net'}."/".$bits." dev remote"; } } $utildata->{nodeonmynetdata}->{pid}=$$; - $utildata->{nodeonmynetdata}->{n} + $utildata->{nodeonmynetdata}->{nets} = \@nets; + } foreach (@nets) { my @elems = split /\s+/; diff --git a/xCAT-server/lib/xcat/plugins/dhcp.pm b/xCAT-server/lib/xcat/plugins/dhcp.pm index 8ebd4d221..d84cc16db 100644 --- a/xCAT-server/lib/xcat/plugins/dhcp.pm +++ b/xCAT-server/lib/xcat/plugins/dhcp.pm @@ -16,7 +16,6 @@ use Fcntl ':flock'; my @dhcpconf; #Hold DHCP config file contents to be written back. my @nrn; # To hold output of networks table to be consulted throughout process -my $haveremotenics; my $domain; my $omshell; my $statements; #Hold custom statements to be slipped into host declarations @@ -475,7 +474,6 @@ sub process_request my $nm = $_->{mask}; #$callback->({data => ["array of nets $n : $if : $nm"]}); if ($if =~ /!remote!/) { #only take in networks with special interface - $haveremotenics=1; push @nrn, "$n:$if:$nm"; } } @@ -618,7 +616,7 @@ sub process_request } else { - unless ($haveremotenics or xCAT::Utils->nodeonmynet($_)) + unless (xCAT::Utils->nodeonmynet($_)) { next; }