diff options
author | Bob Gilligan <gilligan@vyatta.com> | 2009-09-09 17:08:21 -0700 |
---|---|---|
committer | Bob Gilligan <gilligan@vyatta.com> | 2009-09-09 17:08:21 -0700 |
commit | 84fb2f920765c6d02f35ef1654dc0f8c2bef648c (patch) | |
tree | 493347299b4d3069984a289b9737d72e78e7c40b /templates | |
parent | 42abfac6f11077dbfc3b0eaf845597e38f7cd685 (diff) | |
download | vyatta-cfg-84fb2f920765c6d02f35ef1654dc0f8c2bef648c.tar.gz vyatta-cfg-84fb2f920765c6d02f35ef1654dc0f8c2bef648c.zip |
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.
Diffstat (limited to 'templates')
-rw-r--r-- | templates/interfaces/ethernet/node.tag/address/node.def | 17 |
1 files changed, 16 insertions, 1 deletions
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: <x.x.x.x/x> Set the IP address and prefix length <h:h:h:h:h:h:h:h/x> Set the IPv6 address and prefix length |