summaryrefslogtreecommitdiff
path: root/scripts/vyatta-bonding.pl
diff options
context:
space:
mode:
authorStephen Hemminger <stephen.hemminger@vyatta.com>2009-07-07 14:31:38 -0700
committerAn-Cheng Huang <ancheng@vyatta.com>2009-07-17 14:56:05 -0700
commit21413b1020d5233e5f122da72e36789697e6db9e (patch)
treeda042c52588fd14ad4ad1965472e26b4d574b84a /scripts/vyatta-bonding.pl
parent3d55d4142307d29e513e4ecadf36604b32d4677a (diff)
downloadvyatta-cfg-quagga-21413b1020d5233e5f122da72e36789697e6db9e.tar.gz
vyatta-cfg-quagga-21413b1020d5233e5f122da72e36789697e6db9e.zip
Revert "Allow user to select round-robin mode."
This reverts commit aba4e42b4b07b856cbcff0fcf5231824fc18bb37. Use proper perl (ie. undefined) rather than a a sentinel value! (cherry picked from commit 7c681e2a62388ead8ad2e74a76ff1b0ae386f78f)
Diffstat (limited to 'scripts/vyatta-bonding.pl')
-rwxr-xr-xscripts/vyatta-bonding.pl29
1 files changed, 8 insertions, 21 deletions
diff --git a/scripts/vyatta-bonding.pl b/scripts/vyatta-bonding.pl
index e2cc627d..2f2167fa 100755
--- a/scripts/vyatta-bonding.pl
+++ b/scripts/vyatta-bonding.pl
@@ -36,32 +36,19 @@ use strict;
use warnings;
my %modes = (
- ## Linux bonding driver modes + 1
- ## (eg. bond driver expects round-robin = 0)
- "invalid_opt" => 0,
- "round-robin" => 1,
- "active-backup" => 2,
- "xor-hash" => 3,
- "broadcast" => 4,
- "802.3ad" => 5,
- "transmit-load-balance" => 6,
- "adaptive-load-balance" => 7,
+ "round-robin" => 0,
+ "active-backup" => 1,
+ "xor-hash" => 2,
+ "broadcast" => 3,
+ "802.3ad" => 4,
+ "transmit-load-balance" => 5,
+ "adaptive-load-balance" => 6,
);
sub set_mode {
my ($intf, $mode) = @_;
- my $request_mode = $mode;
my $val = $modes{$mode};
-
- ## Check if vaild bonding option is requested.
- foreach my $item ( keys(%modes) ) {
- $mode = "invalid_opt" unless( $mode =~ m/$item/);
- };
- die "Unknown bonding mode $request_mode\n" unless $val;
-
- ## After above bonding option check, adjust value
- ## to value the expected by bonding driver. -MOB
- $val = ($val - 1);
+ die "Unknown bonding mode $mode\n" unless $val;
open my $fm, '>', "/sys/class/net/$intf/bonding/mode"
or die "Error: $intf is not a bonding device:$!\n";