summaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
authorStephen Hemminger <stephen.hemminger@vyatta.com>2009-07-07 13:39:58 -0700
committerStephen Hemminger <stephen.hemminger@vyatta.com>2009-07-07 14:16:15 -0700
commitca8bff3d63074c52cf9b532eeec3a6a4cfe76722 (patch)
tree1620dfd57569fba6daa06aea68a29fb457dffd64 /templates
parentf11caa95b267a3b607bc2f2ae5fd41e1637fe9ca (diff)
downloadvyatta-cfg-system-ca8bff3d63074c52cf9b532eeec3a6a4cfe76722.tar.gz
vyatta-cfg-system-ca8bff3d63074c52cf9b532eeec3a6a4cfe76722.zip
Block creating vif until after slaves present
Workaround for bonding VLAN_CHALLENGED bug 4694
Diffstat (limited to 'templates')
-rw-r--r--templates/interfaces/bonding/node.tag/vif/node.def13
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(@)