From 619c518bfc904b060b5b59180940a804fe1beafd Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Mon, 19 Apr 2021 20:02:02 +0200 Subject: T2175: properly exist FRR "router" context when rendering templates When rendering a dynamic routing protocol ensure the context, e.g. "router bgp" or "router ospf" is proberly exited before applying any zebra route-map. --- data/templates/frr/bgp.frr.tmpl | 1 + data/templates/frr/isis.frr.tmpl | 1 + data/templates/frr/ospf.frr.tmpl | 1 + data/templates/frr/ospfv3.frr.tmpl | 1 + data/templates/frr/rip.frr.tmpl | 1 + data/templates/frr/ripng.frr.tmpl | 1 + 6 files changed, 6 insertions(+) (limited to 'data/templates/frr') diff --git a/data/templates/frr/bgp.frr.tmpl b/data/templates/frr/bgp.frr.tmpl index dafe45f59..cc7f79a6c 100644 --- a/data/templates/frr/bgp.frr.tmpl +++ b/data/templates/frr/bgp.frr.tmpl @@ -459,6 +459,7 @@ router bgp {{ local_as }} {{ 'vrf ' + vrf if vrf is defined and vrf is not none {% if timers is defined and timers.keepalive is defined and timers.holdtime is defined %} timers bgp {{ timers.keepalive }} {{ timers.holdtime }} {% endif %} + exit ! {% if route_map is defined and route_map is not none %} ip protocol bgp route-map {{ route_map }} diff --git a/data/templates/frr/isis.frr.tmpl b/data/templates/frr/isis.frr.tmpl index c8e11399e..46400664f 100644 --- a/data/templates/frr/isis.frr.tmpl +++ b/data/templates/frr/isis.frr.tmpl @@ -173,6 +173,7 @@ interface {{ iface }} {{ 'vrf ' + vrf if vrf is defined and vrf is not none }} {% endif %} {% endfor %} {% endif %} + exit ! {% if route_map is defined and route_map is not none %} ip protocol isis route-map {{ route_map }} diff --git a/data/templates/frr/ospf.frr.tmpl b/data/templates/frr/ospf.frr.tmpl index a47c64c89..fd2082d5c 100644 --- a/data/templates/frr/ospf.frr.tmpl +++ b/data/templates/frr/ospf.frr.tmpl @@ -176,6 +176,7 @@ router ospf {{ 'vrf ' + vrf if vrf is defined and vrf is not none }} {# Timer values have default values #} timers throttle spf {{ timers.throttle.spf.delay }} {{ timers.throttle.spf.initial_holdtime }} {{ timers.throttle.spf.max_holdtime }} {% endif %} + exit ! {% if route_map is defined and route_map is not none %} ip protocol ospf route-map {{ route_map }} diff --git a/data/templates/frr/ospfv3.frr.tmpl b/data/templates/frr/ospfv3.frr.tmpl index d08972a80..34b22a3e3 100644 --- a/data/templates/frr/ospfv3.frr.tmpl +++ b/data/templates/frr/ospfv3.frr.tmpl @@ -81,4 +81,5 @@ router ospf6 redistribute {{ protocol }} {{ 'route-map ' + options.route_map if options.route_map is defined }} {% endfor %} {% endif %} + exit ! diff --git a/data/templates/frr/rip.frr.tmpl b/data/templates/frr/rip.frr.tmpl index cabc236f0..748dfb126 100644 --- a/data/templates/frr/rip.frr.tmpl +++ b/data/templates/frr/rip.frr.tmpl @@ -89,6 +89,7 @@ router rip {% endif %} {% endif %} {% include 'frr/rip_ripng.frr.j2' %} + exit ! {% if route_map is defined and route_map is not none %} ip protocol rip route-map {{ route_map }} diff --git a/data/templates/frr/ripng.frr.tmpl b/data/templates/frr/ripng.frr.tmpl index 25df15121..c92946bb3 100644 --- a/data/templates/frr/ripng.frr.tmpl +++ b/data/templates/frr/ripng.frr.tmpl @@ -57,4 +57,5 @@ router ripng {% endif %} {% endif %} {% include 'frr/rip_ripng.frr.j2' %} + exit ! -- cgit v1.2.3