diff options
author | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2009-07-28 21:13:29 -0700 |
---|---|---|
committer | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2009-07-28 21:13:29 -0700 |
commit | 04ce9d5d2bead676a9961b91cb9ec41a0ec73d38 (patch) | |
tree | 232232d03c2688d6c6a90e304805a02353fe688b | |
parent | b982f12a9e1b8fe9b7fddf195e5c2672e77ee271 (diff) | |
download | vyatta-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-x | scripts/vyatta-bonding.pl | 2 |
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 ); |