From 04ce9d5d2bead676a9961b91cb9ec41a0ec73d38 Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Tue, 28 Jul 2009 21:13:29 -0700 Subject: Handle case of bond device with no slaves Bug 4761 Don't use uninitialized variable. Function should return empty undef unless slaves exist. --- scripts/vyatta-bonding.pl | 2 ++ 1 file changed, 2 insertions(+) (limited to 'scripts') 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 ); -- cgit v1.2.3