From 238fca3e73f56cfe4b49c4363a375f78436f0411 Mon Sep 17 00:00:00 2001 From: Dennis de Houx <152706174+Dennis-de-Houx@users.noreply.github.com> Date: Fri, 19 Apr 2024 04:31:22 +0200 Subject: [PATCH] Change order of community-prefs and as-prefs See issue "Priority of community-prefs and as-prefs #198" --- pkg/embed/templates/peer.tmpl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkg/embed/templates/peer.tmpl b/pkg/embed/templates/peer.tmpl index f8e7b011..979b3492 100644 --- a/pkg/embed/templates/peer.tmpl +++ b/pkg/embed/templates/peer.tmpl @@ -144,10 +144,6 @@ protocol bgp {{ UniqueProtocolName $peer.ProtocolName $peerName $af $peer.ASN $p {{ if IntDeref $peer.LocalPref4 }}if (net.type = NET_IP4) then { bgp_local_pref = {{ $peer.LocalPref4 }}; }{{ end }} {{ if IntDeref $peer.LocalPref6 }}if (net.type = NET_IP6) then { bgp_local_pref = {{ $peer.LocalPref6 }}; }{{ end }} - {{ range $asn, $pref := Uint32MapDeref $peer.ASPrefs }} - if ({{ $asn }} ~ bgp_path) then { bgp_local_pref = {{ $pref }}; } - {{ end }} - {{ range $community, $pref := StringUint32MapDeref $peer.StandardCommunityPrefs }} if (({{ $community }}) ~ bgp_community) then { bgp_local_pref = {{ $pref }}; } {{ end }} @@ -155,6 +151,10 @@ protocol bgp {{ UniqueProtocolName $peer.ProtocolName $peerName $af $peer.ASN $p if (({{ $community }}) ~ bgp_large_community) then { bgp_local_pref = {{ $pref }}; } {{ end }} + {{ range $asn, $pref := Uint32MapDeref $peer.ASPrefs }} + if ({{ $asn }} ~ bgp_path) then { bgp_local_pref = {{ $pref }}; } + {{ end }} + {{ if BoolDeref $peer.AllowBlackholeCommunity }}process_blackholes();{{ end }} {{ if BoolDeref $peer.HonorGracefulShutdown }}honor_graceful_shutdown();{{ end }}