Skip to content

Commit

Permalink
Change order of community-prefs and as-prefs
Browse files Browse the repository at this point in the history
See issue "Priority of community-prefs and as-prefs natesales#198"
  • Loading branch information
Dennis-de-Houx authored Apr 19, 2024
1 parent 657093e commit 238fca3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pkg/embed/templates/peer.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -144,17 +144,17 @@ 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 }}
{{ range $community, $pref := StringUint32MapDeref $peer.LargeCommunityPrefs }}
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 }}

Expand Down

0 comments on commit 238fca3

Please sign in to comment.