From b0c1f8565931400f9fa3f67bb23bef93576901cd Mon Sep 17 00:00:00 2001 From: Stig Thormodsrud Date: Wed, 13 Feb 2008 15:24:36 -0800 Subject: Fix 1513 BGP - peer-port and local-port accept invalid values --- .../bgp/node.tag/neighbor/node.tag/port/node.def | 29 ++++++++++++++-------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/templates/protocols/bgp/node.tag/neighbor/node.tag/port/node.def b/templates/protocols/bgp/node.tag/neighbor/node.tag/port/node.def index ef388c01..4be26de8 100644 --- a/templates/protocols/bgp/node.tag/neighbor/node.tag/port/node.def +++ b/templates/protocols/bgp/node.tag/neighbor/node.tag/port/node.def @@ -1,14 +1,23 @@ type: u32 help: Neighbor's BGP port -syntax:expression: $VAR(@) >= 1 && $VAR(@) <= 4294967294; "remote-as must be between 1 and 4294967294" +syntax:expression: $VAR(@) >= 1 && $VAR(@) <= 4294967294; \ + "port must be between 1 and 4294967294" commit:expression: exec "/opt/vyatta/sbin/vyatta-bgp.pl --check-as --as $VAR(../../@) --neighbor $VAR(../@)" -update:expression: "if [ -n \"$VAR(../remote-as/@)\" ]; then \ - peer=\"remote-as $VAR(../remote-as/@)\"; \ - else \ - peer=\"peer-group $VAR(../peer-group/@)\"; \ - fi; \ - ${vyatta_sbindir}/vyatta-vtysh.pl -c \"configure terminal\" -c \"router bgp $VAR(../../@)\" \ - -c \"neighbor $VAR(../@) $peer\" \ + +update:expression: "\ + if [ -n \"$VAR(../remote-as/@)\" ]; then \ + peer=\"remote-as $VAR(../remote-as/@)\"; \ + else \ + peer=\"peer-group $VAR(../peer-group/@)\"; \ + fi; \ + ${vyatta_sbindir}/vyatta-vtysh.pl -c \"configure terminal\" \ + -c \"router bgp $VAR(../../@)\" \ + -c \"neighbor $VAR(../@) $peer\" \ -c \"neighbor $VAR(../@) port $VAR(@)\" " -delete:expression: "${vyatta_sbindir}/vyatta-vtysh.pl -noerr -c \"configure terminal\" -c \"router bgp $VAR(../../@)\" \ - -c \"no neighbor $VAR(../@) port \" " + +delete:expression: "${vyatta_sbindir}/vyatta-vtysh.pl -noerr \ + -c \"configure terminal\" -c \"router bgp $VAR(../../@)\" \ + -c \"no neighbor $VAR(../@) port \" " + +comp_help: possible completions: + <1-4294967294> Set neighbor's BGP port -- cgit v1.2.3