From 17e2c2a0d313794ecc46fefcb6995af0567226ff Mon Sep 17 00:00:00 2001 From: yinle Date: Wed, 19 Oct 2011 09:08:01 +0000 Subject: [PATCH] Fix bug 3425775: lsslp plugin bug /opt/xcat/lib/perl/xCAT/NetworkUtils.pm git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@10840 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- perl-xCAT/xCAT/NetworkUtils.pm | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/perl-xCAT/xCAT/NetworkUtils.pm b/perl-xCAT/xCAT/NetworkUtils.pm index c83760818..2a74f8eaf 100755 --- a/perl-xCAT/xCAT/NetworkUtils.pm +++ b/perl-xCAT/xCAT/NetworkUtils.pm @@ -566,16 +566,17 @@ sub get_nic_ip # en1: ... # ############################################################## - my @adapter = split /\w+\d+:\s+flags=/, $result; + my @adapter = split /(\w+\d+):\s+flags=/, $result; foreach ( @adapter ) { + if ($_ =~ /^(en\d)/) { + $nic = $1; + next; + } if ( !($_ =~ /LOOPBACK/ ) and $_ =~ /UP(,|>)/ and $_ =~ /$mode/ ) { my @ip = split /\n/; for my $ent ( @ip ) { - if ($ent =~ /^(en\d)\s+/) { - $nic = $1; - } if ( $ent =~ /^\s*inet\s+(\d+\.\d+\.\d+\.\d+)/ ) { $iphash{$nic} = $1; next;