From 806a705775387fff477999ceed051b5aa29d6084 Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Fri, 15 Oct 2010 15:33:02 -0700 Subject: Add ability to set transmit hash policy --- templates/interfaces/bonding/node.tag/hash-policy/node.def | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 templates/interfaces/bonding/node.tag/hash-policy/node.def diff --git a/templates/interfaces/bonding/node.tag/hash-policy/node.def b/templates/interfaces/bonding/node.tag/hash-policy/node.def new file mode 100644 index 00000000..54c2bb0f --- /dev/null +++ b/templates/interfaces/bonding/node.tag/hash-policy/node.def @@ -0,0 +1,13 @@ +type: txt +default: "layer2" +allowed: echo "layer2 layer2+3 layer3+4" +syntax:expression: $VAR(@) in "layer2", "layer2+3", "layer3+4" \ + ; "hash_policy must be layer2 layer3+4 or layer2+3" +help: Bonding transmit hash policy + +update: sudo sh -c \ + "echo $VAR(@) >/sys/class/net/$VAR(../@)/bonding/xmit_hash_policy" + +val_help: layer2; use MAC addresses to generate the hash (802.3ad) +val_help: layer2+3; combine MAC address and IP address to make hash +val_help: layer3+4; combine IP address and port to make hash -- cgit v1.2.3 From 22f82a0fb8ad3ed890c82a7a568390a29cf5116e Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Fri, 15 Oct 2010 15:54:50 -0700 Subject: Handle error cases on console update If inittab doesn't exist or console not configured, just do nothing. --- scripts/system/vyatta_update_console.pl | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/scripts/system/vyatta_update_console.pl b/scripts/system/vyatta_update_console.pl index 3c3b7d2d..2ee57583 100644 --- a/scripts/system/vyatta_update_console.pl +++ b/scripts/system/vyatta_update_console.pl @@ -41,7 +41,7 @@ sub update_inittab { my ($inpath, $outpath) = @_; open (my $inittab, '<', $inpath) - or die "Can't open $inpath: $!"; + or return; open (my $tmp, '>', $outpath) or die "Can't open $outpath: $!"; @@ -81,7 +81,10 @@ sub update_grub { my ($inpath, $outpath) = @_; my $config = new Vyatta::Config; - my $speed = $config->returnValue("system console device ttyS0 speed"); + $config->setlevel("system console device"); + return unless $config->exists("ttyS0"); + + my $speed = $config->returnValue("ttyS0 speed"); $speed = "9600" unless defined($speed); open (my $grub, '<', $inpath) -- cgit v1.2.3