From 7a6c522c3968712b05cf6d1dc473219ec6edf6a6 Mon Sep 17 00:00:00 2001 From: Mohit Mehta Date: Mon, 17 Nov 2008 17:43:09 -0800 Subject: add check for bond vif interface to submodule --- scripts/vyatta-interfaces.pl | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/scripts/vyatta-interfaces.pl b/scripts/vyatta-interfaces.pl index 6ece6c0..2a47bce 100644 --- a/scripts/vyatta-interfaces.pl +++ b/scripts/vyatta-interfaces.pl @@ -129,6 +129,8 @@ sub is_address_enabled { ## FIXME this is name based madness find a better way ## so we don't have to redo with each interface type! + ## POSSIBLE SOLUTION: pass the cli-path uptill 'address' node from + ## address/node.def so we don't have to determine the address type here if ($intf =~ m/^eth/) { if ($intf =~ m/(\w+)\.(\d+)/) { $config->setLevel("interfaces ethernet $1 vif $2"); @@ -136,7 +138,11 @@ sub is_address_enabled { $config->setLevel("interfaces ethernet $intf"); } } elsif ($intf =~ m/^bond/) { - $config->setLevel("interfaces bonding $intf"); + if ($intf =~ m/(\w+)\.(\d+)/) { + $config->setLevel("interfaces bonding $1 vif $2"); + } else { + $config->setLevel("interfaces bonding $intf"); + } } elsif ($intf =~ m/^br/) { $config->setLevel("interfaces bridge $intf"); } else { -- cgit v1.2.3