From 84fb2f920765c6d02f35ef1654dc0f8c2bef648c Mon Sep 17 00:00:00 2001 From: Bob Gilligan Date: Wed, 9 Sep 2009 17:08:21 -0700 Subject: Bugfix 4700, 4269: Fix set and commit-time checks of ethernet address values Changed the the set-time and commit-time check of ethernet interface address values. These checks need to prevent configuring both DHCP and static IPv4 addresses on the same interfac. The previous checks were comparing against the running configuration tree, not the proposed config tree. Now the set-time check is purely a syntax check, and the commit-time check only checks for both DHCP and static IPv4 addresses in the proposed config. The system now allows DHCP and static IPv6 addresses to be configured on the same interface. --- templates/interfaces/ethernet/node.tag/address/node.def | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'templates') diff --git a/templates/interfaces/ethernet/node.tag/address/node.def b/templates/interfaces/ethernet/node.tag/address/node.def index dd4d5fa..db87ff0 100644 --- a/templates/interfaces/ethernet/node.tag/address/node.def +++ b/templates/interfaces/ethernet/node.tag/address/node.def @@ -1,11 +1,26 @@ 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(../@)"\ + +# Syntax check at "set" time. Give curent address value to script +# so that it can perform syntax check. +# +syntax:expression: exec "/opt/vyatta/sbin/vyatta-interfaces.pl --valid-addr-set $VAR(@) --dev $VAR(../@)"\ ; "Invalid IP address/prefix [$VAR(@)] for interface $VAR(../@)" + +# Syntax check at "commit" time. Pass all address values to script so that +# it can perform consistency check. +# +commit:expression: exec "/opt/vyatta/sbin/vyatta-interfaces.pl --valid-addr-commit $VAR(@@) --dev $VAR(../@)" + create:sudo /opt/vyatta/sbin/vyatta-interfaces.pl --eth-addr-update $VAR(@) --dev $VAR(../@) + delete:sudo /opt/vyatta/sbin/vyatta-interfaces.pl --eth-addr-delete $VAR(@) --dev $VAR(../@) + allowed: echo "dhcp <>" + comp_help:Possible completions: Set the IP address and prefix length Set the IPv6 address and prefix length -- cgit v1.2.3