diff options
author | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2009-07-07 13:39:58 -0700 |
---|---|---|
committer | An-Cheng Huang <ancheng@vyatta.com> | 2009-07-17 14:56:05 -0700 |
commit | e653e618e4bb55db664725b92f06e39c568d7bb8 (patch) | |
tree | 1f77213f16057f459746fee990dc7809870d73aa /templates/interfaces | |
parent | fd48be9e4f0971a42bb9e74388e2cf3be12c3434 (diff) | |
download | vyatta-cfg-quagga-e653e618e4bb55db664725b92f06e39c568d7bb8.tar.gz vyatta-cfg-quagga-e653e618e4bb55db664725b92f06e39c568d7bb8.zip |
Block creating vif until after slaves present
Workaround for bonding VLAN_CHALLENGED bug 4694
(cherry picked from commit ca8bff3d63074c52cf9b532eeec3a6a4cfe76722)
Diffstat (limited to 'templates/interfaces')
-rw-r--r-- | templates/interfaces/bonding/node.tag/vif/node.def | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/templates/interfaces/bonding/node.tag/vif/node.def b/templates/interfaces/bonding/node.tag/vif/node.def index 13a35b12..0e292217 100644 --- a/templates/interfaces/bonding/node.tag/vif/node.def +++ b/templates/interfaces/bonding/node.tag/vif/node.def @@ -2,13 +2,12 @@ tag: type: u32 help: Set Virtual Local Area Network (VLAN) ID syntax:expression: $VAR(@) >= 0 && $VAR(@) <= 4094; "VLAN ID must be between 0 and 4094" -create: read flags < /sys/class/net/$VAR(../@)/flags - if [ $(( flags & 1 )) -eq 0 ] - then - echo "Can not create VLAN on disabled interface: " $VAR(../@) - exit 1 - fi - sudo ip link add link $VAR(../@) name "$VAR(../@).$VAR(@)" type vlan id $VAR(@) || exit 1 +create: read -a SLAVES </sys/class/net/$VAR(../@)/bonding/slaves + if [ ${#SLAVES[*]} -eq 0 ]; then + echo "Must configure slave devices for bond interface $VAR(../@) before adding vif" + exit 1 + fi + sudo ip link add link $VAR(../@) name "$VAR(../@).$VAR(@)" type vlan id $VAR(@) || exit 1 sudo ip link set "$VAR(../@).$VAR(@)" up sudo sh -c "/opt/vyatta/sbin/vyatta-link-detect $VAR(../@).$VAR(@) on" delete: sudo ip link delete dev "$VAR(../@).$VAR(@)" type vlan id $VAR(@) |