mirror of
https://github.com/xcat2/xcat-core.git
synced 2025-09-03 00:38:18 +00:00
Have dhcp.pm use ip instead of netstat
This commit is contained in:
@@ -1696,11 +1696,13 @@ sub process_request
|
||||
}
|
||||
else
|
||||
{
|
||||
my @nsrnoutput = split /\n/, `/bin/netstat -rn`;
|
||||
my @nsrnoutput = split /\n/, `ip -4 route`;
|
||||
splice @nsrnoutput, 0, 2;
|
||||
foreach (@nsrnoutput) { #scan netstat
|
||||
my @parts = split /\s+/;
|
||||
push @nrn, $parts[0] . ":" . $parts[7] . ":" . $parts[2] . ":" . $parts[3];
|
||||
my ($subnetip, $subnetcidr) = split('/', $parts[0]);
|
||||
$subnetcidr = xCAT::NetworkUtils::formatNetmask($subnetcidr, 1, 0);
|
||||
push @nrn, $subnetip . ":" . $parts[2] . ":" . $subnetcidr . ":" . $parts[1];
|
||||
}
|
||||
my @ip6routes = `ip -6 route`;
|
||||
foreach (@ip6routes) {
|
||||
@@ -2003,7 +2005,7 @@ sub process_request
|
||||
}
|
||||
|
||||
#if ($activenics{$line[1]} and $line[3] !~ /G/)
|
||||
if ($activenics{$netif} and $line[3] !~ /G/)
|
||||
if ($activenics{$netif} and $line[3] !~ /via/)
|
||||
{
|
||||
addnet($line[0], $line[2]);
|
||||
}
|
||||
|
Reference in New Issue
Block a user