summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephen Hemminger <stephen.hemminger@vyatta.com>2009-07-28 21:13:29 -0700
committerStephen Hemminger <stephen.hemminger@vyatta.com>2009-07-28 21:13:29 -0700
commit04ce9d5d2bead676a9961b91cb9ec41a0ec73d38 (patch)
tree232232d03c2688d6c6a90e304805a02353fe688b
parentb982f12a9e1b8fe9b7fddf195e5c2672e77ee271 (diff)
downloadvyatta-cfg-system-04ce9d5d2bead676a9961b91cb9ec41a0ec73d38.tar.gz
vyatta-cfg-system-04ce9d5d2bead676a9961b91cb9ec41a0ec73d38.zip
Handle case of bond device with no slaves
Bug 4761 Don't use uninitialized variable. Function should return empty undef unless slaves exist.
-rwxr-xr-xscripts/vyatta-bonding.pl2
1 files changed, 2 insertions, 0 deletions
diff --git a/scripts/vyatta-bonding.pl b/scripts/vyatta-bonding.pl
index 53e6bffa..5e90948b 100755
--- a/scripts/vyatta-bonding.pl
+++ b/scripts/vyatta-bonding.pl
@@ -64,6 +64,8 @@ sub get_slaves {
or die "$intf is not a bonding interface";
my $slaves = <$f>;
close $f;
+ return unless $slaves;
+
chomp $slaves;
return split( ' ', $slaves );