fix for IPv6, my_nets, do not return IPv6 networks on Linux for now

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@6326 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
ligc 2010-06-03 01:33:33 +00:00
parent f51f231a15
commit 87a3e305a3

View File

@ -2209,11 +2209,19 @@ sub my_nets
}
else
{
if ($elems[1] eq 'inet6')
{
next; #Linux IPv6 TODO, do not return IPv6 networks on Linux for now
}
($curnet, $maskbits) = split /\//, $elems[2];
}
if (!$v6net)
{
my $curmask = 2**$maskbits - 1 << (32 - $maskbits);
if (!$curnet)
{
next;
}
my $nown = unpack("N", inet_aton($curnet));
$nown = $nown & $curmask;
my $textnet=inet_ntoa(pack("N",$nown));
@ -2238,6 +2246,10 @@ sub my_nets
my $n = $_->{net};
my $if = $_->{mgtifname};
my $nm = $_->{mask};
if (!$n || !$if || $nm)
{
next; #incomplete network
}
if ($if =~ /!remote!/) { #only take in networks with special interface
$nm = formatNetmask($nm, 0 , 1);
$n .="/$nm";