summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2020-05-10 12:47:23 +0200
committerChristian Poessinger <christian@poessinger.com>2020-05-10 12:47:23 +0200
commit4bddd73e12d007a6a08a798652c7e993cfa93e75 (patch)
treecff078a62fd3991801a36e05159c2e46aca260c5
parentfbe63a5016a3fb1c16a01b3218bab2af2bd4a0d5 (diff)
downloadvyatta-cfg-quagga-4bddd73e12d007a6a08a798652c7e993cfa93e75.tar.gz
vyatta-cfg-quagga-4bddd73e12d007a6a08a798652c7e993cfa93e75.zip
vrf: T2445: fix next-hop-vrf for route leaking
-rw-r--r--templates/protocols/vrf/node.tag/static/route/node.tag/next-hop/node.def15
1 files changed, 12 insertions, 3 deletions
diff --git a/templates/protocols/vrf/node.tag/static/route/node.tag/next-hop/node.def b/templates/protocols/vrf/node.tag/static/route/node.tag/next-hop/node.def
index ec7a9eed..67842168 100644
--- a/templates/protocols/vrf/node.tag/static/route/node.tag/next-hop/node.def
+++ b/templates/protocols/vrf/node.tag/static/route/node.tag/next-hop/node.def
@@ -3,8 +3,7 @@ type: ipv4
help: Next-hop router
end:
VRF_NAME=$VAR(../../../@)
- if [[ -z "$VAR(./disable)" ]]
- then
+ if [[ -z "$VAR(./disable)" ]]; then
### remove the old entry from frr first on an update
if [ ${COMMIT_ACTION} = 'ACTIVE' ]
then
@@ -24,8 +23,18 @@ end:
-c "no ip route $VAR(../@) $VAR(@) vrf $VRF_NAME"
fi
else
+ if [[ -n "$VAR(./distance/@)" ]]; then
+ DIST="$VAR(./distance/@)"
+ fi
+ if [[ -n "$VAR(./next-hop-interface/@)" ]]; then
+ NEXTHOP_INT="$VAR(./next-hop-interface/@)"
+ fi
+ if [[ -n "$VAR(./next-hop-vrf/@)" ]]; then
+ NEXTHOP_VRF="nexthop-vrf $VAR(./next-hop-vrf/@)"
+ fi
vtysh -c "configure terminal" \
- -c "ip route $VAR(../@) $VAR(@) $VAR(./next-hop-interface/@) vrf $VRF_NAME $VAR(./distance/@)";
+ -c "vrf $VRF_NAME" \
+ -c "ip route $VAR(../@) $VAR(@) $NEXTHOP_INT $NEXTHOP_VRF $DIST";
fi
else
if ${vyatta_sbindir}/vyatta-gateway-static_route-check.pl \