summaryrefslogtreecommitdiff
path: root/templates/interfaces/bridge
diff options
context:
space:
mode:
authorMohit Mehta <mohit.mehta@vyatta.com>2008-11-19 18:17:24 -0800
committerMohit Mehta <mohit.mehta@vyatta.com>2008-11-19 18:17:24 -0800
commit147fc08625ce3245c32367a4dac227b71f05b562 (patch)
treef05a8244ab23a7685ee2f95c7c60316a7be05b7a /templates/interfaces/bridge
parent29b722f990081cc2a9f6b91c4bc6133eb338388c (diff)
downloadvyatta-cfg-system-147fc08625ce3245c32367a4dac227b71f05b562.tar.gz
vyatta-cfg-system-147fc08625ce3245c32367a4dac227b71f05b562.zip
Fix Bug 3917 dhcp brings interface up for lease acquire/renew even though interface has been disabled in CLI
Diffstat (limited to 'templates/interfaces/bridge')
-rw-r--r--templates/interfaces/bridge/node.tag/address/node.def6
-rw-r--r--templates/interfaces/bridge/node.tag/disable/node.def18
2 files changed, 17 insertions, 7 deletions
diff --git a/templates/interfaces/bridge/node.tag/address/node.def b/templates/interfaces/bridge/node.tag/address/node.def
index 3f04ec06..6e07ea7f 100644
--- a/templates/interfaces/bridge/node.tag/address/node.def
+++ b/templates/interfaces/bridge/node.tag/address/node.def
@@ -2,8 +2,10 @@ multi:
type: txt
help: Set an IP address for this interface
syntax:expression: exec "/opt/vyatta/sbin/vyatta-interfaces.pl --valid-addr $VAR(@) --dev $VAR(../@)"; "Invalid IP address/prefix [$VAR(@)] for interface $VAR(../@)"
-update:expression: "sudo /opt/vyatta/sbin/vyatta-interfaces.pl --eth-addr-update $VAR(@) --dev $VAR(../@)"; "Error setting address $VAR(@) on interface $VAR(../@)"
-delete:expression: "sudo /opt/vyatta/sbin/vyatta-interfaces.pl --eth-addr-delete $VAR(@) --dev $VAR(../@)"; "Error deleting address $VAR(@) on interface $VAR(../@)"
+update:expression: "sudo /opt/vyatta/sbin/vyatta-interfaces.pl --eth-addr-update $VAR(@) --dev $VAR(../@) \
+--intf-cli-path \"interfaces bridge $VAR(../@)\""; "Error setting address $VAR(@) on interface $VAR(../@)"
+delete:expression: "sudo /opt/vyatta/sbin/vyatta-interfaces.pl --eth-addr-delete $VAR(@) --dev $VAR(../@) \
+--intf-cli-path \"interfaces bridge $VAR(../@)\""; "Error deleting address $VAR(@) on interface $VAR(../@)"
allowed: echo "dhcp <>"
comp_help:Possible completions:
<x.x.x.x/x> Set the IP address and prefix length
diff --git a/templates/interfaces/bridge/node.tag/disable/node.def b/templates/interfaces/bridge/node.tag/disable/node.def
index 3aa26012..f4495164 100644
--- a/templates/interfaces/bridge/node.tag/disable/node.def
+++ b/templates/interfaces/bridge/node.tag/disable/node.def
@@ -1,11 +1,19 @@
type: bool
help: Disable the bridge interface
default: false
-update:expression: "if [ x$VAR(@) == xtrue ]; then \
- sudo ip link set $VAR(../@) down; \
- else \
- sudo ip link set $VAR(../@) up; \
- fi; "
+update: if [ x$VAR(@) == xtrue ]; then
+ /etc/netplug/linkdown.d/dhclient $VAR(../@)
+ if ! sudo ip link set $VAR(../@) down 2>/dev/null; then
+ echo "Error disabling dev $VAR(../@)"
+ /etc/netplug/linkup.d/dhclient $VAR(../@)
+ exit 1
+ fi
+ else
+ if ! sudo ip link set $VAR(../@) up; then
+ echo "Error enabling dev $VAR(../@)"
+ exit 1
+ fi
+ fi
comp_help: possible completions:
true Disable the bridge interface
false Enable the bridge interface (default)