From 87a3e305a30a1edc8a57e38e78655cdcd46cb4dd Mon Sep 17 00:00:00 2001 From: ligc Date: Thu, 3 Jun 2010 01:33:33 +0000 Subject: [PATCH] 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 --- perl-xCAT/xCAT/Utils.pm | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/perl-xCAT/xCAT/Utils.pm b/perl-xCAT/xCAT/Utils.pm index dca55f905..ba08479bc 100644 --- a/perl-xCAT/xCAT/Utils.pm +++ b/perl-xCAT/xCAT/Utils.pm @@ -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";