diff options
author | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2011-06-16 18:27:12 -0400 |
---|---|---|
committer | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2011-06-16 18:27:12 -0400 |
commit | b2a860b1f5a4f48e45dcf1a9fd09a30a531191d5 (patch) | |
tree | bca85962ae31774ab2667cb06352164e36e4d371 /templates/interfaces | |
parent | b848e2034593d4b96ecf0f5612e6e3e4160bb8b3 (diff) | |
download | vyatta-cfg-quagga-b2a860b1f5a4f48e45dcf1a9fd09a30a531191d5.tar.gz vyatta-cfg-quagga-b2a860b1f5a4f48e45dcf1a9fd09a30a531191d5.zip |
Revert "bonding: remove requirement of slaves existing before vif"
This reverts commit 4729a33cdf054cce6780aa4817f9eaccb490ee3f.
Need to put back the check, since it won't work asis
Diffstat (limited to 'templates/interfaces')
-rw-r--r-- | templates/interfaces/bonding/node.tag/vif/node.def | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/templates/interfaces/bonding/node.tag/vif/node.def b/templates/interfaces/bonding/node.tag/vif/node.def index 356bd076..35a00835 100644 --- a/templates/interfaces/bonding/node.tag/vif/node.def +++ b/templates/interfaces/bonding/node.tag/vif/node.def @@ -5,7 +5,12 @@ help: Virtual Local Area Network (VLAN) ID syntax:expression: $VAR(@) >= 0 && $VAR(@) <= 4094; "VLAN ID must be between 0 and 4094" val_help: u32:0-4094; VLAN ID -create: 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 + ip link add link $VAR(../@) name "$VAR(../@).$VAR(@)" type vlan id $VAR(@) || exit 1 ip link set "$VAR(../@).$VAR(@)" up sudo sh -c "/opt/vyatta/sbin/vyatta-link-detect $VAR(../@).$VAR(@) on" |