Skip to content

Commit 05f7142

Browse files
committed
fix: move local pref before as prefs
1 parent 74120a3 commit 05f7142

2 files changed

Lines changed: 5 additions & 4 deletions

File tree

pkg/embed/templates/peer.tmpl

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,14 +121,15 @@ protocol bgp {{ UniqueProtocolName $peer.ProtocolName $af $peer.ASN }} {
121121
bgp_large_community.delete([({{ IntDeref $peer.RemoveAllCommunities }}, *, *)]);
122122
{{ end }}
123123

124+
{{ if not (IntDeref $peer.DefaultLocalPref) }}
125+
{{ if BoolDeref $peer.SetLocalPref }}bgp_local_pref = {{ $peer.LocalPref }}; # pathvector:localpref{{ end }}
126+
{{ end }}
127+
124128
{{ range $asn, $pref := Uint32MapDeref $peer.ASPrefs }}
125129
if ({{ $asn }} ~ bgp_path) then { bgp_local_pref = {{ $pref }}; }
126130
{{ end }}
127131

128132
{{ if BoolDeref $peer.AllowBlackholeCommunity }}process_blackholes();{{ end }}
129-
{{ if not (IntDeref $peer.DefaultLocalPref) }}
130-
{{ if BoolDeref $peer.SetLocalPref }}bgp_local_pref = {{ $peer.LocalPref }}; # pathvector:localpref{{ end }}
131-
{{ end }}
132133
{{ if BoolDeref $peer.HonorGracefulShutdown }}honor_graceful_shutdown();{{ end }}
133134

134135
{{ range $i, $community := StringSliceIter $peer.ImportStandardCommunities }}

pkg/templating/templating.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ package templating
33
import (
44
"embed"
55
"fmt"
6-
"github.com/natesales/pathvector/pkg/util"
76
"os"
87
"strconv"
98
"strings"
@@ -13,6 +12,7 @@ import (
1312
log "github.com/sirupsen/logrus"
1413

1514
"github.com/natesales/pathvector/pkg/config"
15+
"github.com/natesales/pathvector/pkg/util"
1616
)
1717

1818
var protocolNames []string

0 commit comments

Comments
 (0)