summaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
authorRobert Bays <rbays@moresby.vyatta.com>2008-03-17 23:09:48 -0700
committerRobert Bays <rbays@moresby.vyatta.com>2008-03-17 23:09:48 -0700
commit4158c20355825cd0d8505f1307c2756877225f9f (patch)
tree39ade4d38bca2b4d1361c78e7efb3b12f8e548b6 /templates
parent775e849022773e681f6e975e04949d3930cde94d (diff)
downloadvyatta-cfg-quagga-4158c20355825cd0d8505f1307c2756877225f9f.tar.gz
vyatta-cfg-quagga-4158c20355825cd0d8505f1307c2756877225f9f.zip
fix bgp and policy for match community and network backdoor
Diffstat (limited to 'templates')
-rw-r--r--templates/policy/route-map/node.tag/rule/node.tag/match/community/node.def17
-rw-r--r--templates/protocols/bgp/node.tag/network/node.def4
2 files changed, 12 insertions, 9 deletions
diff --git a/templates/policy/route-map/node.tag/rule/node.tag/match/community/node.def b/templates/policy/route-map/node.tag/rule/node.tag/match/community/node.def
index 3ac8e05e..7c6f91c4 100644
--- a/templates/policy/route-map/node.tag/rule/node.tag/match/community/node.def
+++ b/templates/policy/route-map/node.tag/rule/node.tag/match/community/node.def
@@ -1,16 +1,19 @@
help: Match BGP community list
delete: echo route-map $VAR(../../../@) $VAR(../../action/@) $VAR(../../@) >> /tmp/delete-policy-route-map-$VAR(../../../@)-$VAR(../../@)-match-community.$PPID
-## this will always return exact-match pending bug 2525 being fixed
-end: if [ -z "$VAR(./community-list/@)" ]; then
- echo You must configure a community-list ;
- exit 1 ;
- fi ;
- if [ -f /tmp/delete-policy-route-map-$VAR(../../../@)-$VAR(../../@)-match-community.$PPID ]; then
+end: if [ -f /tmp/delete-policy-route-map-$VAR(../../../@)-$VAR(../../@)-match-community.$PPID ]; then
routemap=`cat /tmp/delete-policy-route-map-$VAR(../../../@)-$VAR(../../@)-match-community.$PPID`
rm -f /tmp/delete-policy-route-map-$VAR(../../../@)-$VAR(../../@)-match-community.$PPID;
${vyatta_sbindir}/vyatta-vtysh.pl -noerr -c "configure terminal" -c "$routemap " -c "no match community " ;
exit 0;
else
+ if [ -z "$VAR(./community-list/@)" ]; then
+ echo route-map $VAR(../../../@) rule $VAR(../../@) match community: You must configure a community-list ;
+ exit 1 ;
+ fi ;
+ if [ -z "$VAR(../../action/@)" ]; then
+ echo route-map $VAR(../../../@) rule $VAR(../../@): You must configure an action ;
+ exit 1 ;
+ fi ;
routemap='route-map $VAR(../../../@) $VAR(../../action/@) $VAR(../../@)';
# uncomment and replace the call to vyatta-check-typeless-node.pl pending bug 2525
@@ -23,5 +26,5 @@ end: if [ -z "$VAR(./community-list/@)" ]; then
fi ;
${vyatta_sbindir}/vyatta-vtysh.pl -noerr -c "configure terminal" -c "$routemap " -c "no match community " ;
- ${vyatta_sbindir}/vyatta-vtysh.pl -c \"configure terminal\" -c "$routemap " -c "match community $VAR(./community-list/@) $cond" ;
+ ${vyatta_sbindir}/vyatta-vtysh.pl -c "configure terminal" -c "$routemap " -c "match community $VAR(./community-list/@) $cond" ;
fi
diff --git a/templates/protocols/bgp/node.tag/network/node.def b/templates/protocols/bgp/node.tag/network/node.def
index c6061749..3d547a34 100644
--- a/templates/protocols/bgp/node.tag/network/node.def
+++ b/templates/protocols/bgp/node.tag/network/node.def
@@ -5,7 +5,7 @@ syntax:expression: exec "/opt/vyatta/sbin/vyatta_quagga_utils.pl --check-prefix-
"Prefix doesn't fall on a natural boundry"
commit:expression: !($VAR(./backdoor/) != "" && $VAR(./route-map/) != "");
- "May specify route-map or backdoor but not both"
+ "protocols bgp $VAR(../@) network $VAR(@): May specify route-map or backdoor but not both"
delete: touch /tmp/`echo $VAR(@) | sed 's!/!!'`.$PPID
@@ -24,7 +24,7 @@ end: ${vyatta_sbindir}/vyatta-vtysh.pl -noerr -c "configure terminal" -c "router
fi ;
if [ -n "$VAR(./route-map/@)" ]; then
- COND="route-map $VAR(./route-map/@)";
+ cond="route-map $VAR(./route-map/@)";
fi;
${vyatta_sbindir}/vyatta-vtysh.pl -c "configure terminal" -c "router bgp $VAR(../@)" -c "network $VAR(@) $cond";