Skip to content

Commit

Permalink
fix: create empty peer prefix set (#98)
Browse files Browse the repository at this point in the history
  • Loading branch information
natesales committed Feb 12, 2022
1 parent ba0e595 commit e8a44c8
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions internal/embed/templates/peer.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,16 @@ define AS{{ $peer.ASN }}_{{ $peer.ProtocolName }}_MAXPFX_v6 = {{ $peer.ImportLim
define AS{{ $peer.ASN }}_{{ $peer.ProtocolName }}_PFX_v4 = [
{{ BirdSet $peer.PrefixSet4 }}
];
{{ else }}
define AS{{ $peer.ASN }}_{{ $peer.ProtocolName }}_PFX_v4 = -empty-;
{{ end }}

{{ if not (Empty $peer.PrefixSet6) }}
define AS{{ $peer.ASN }}_{{ $peer.ProtocolName }}_PFX_v6 = [
{{ BirdSet $peer.PrefixSet6 }}
];
{{ else }}
define AS{{ $peer.ASN }}_{{ $peer.ProtocolName }}_PFX_v6 = -empty-;
{{ end }}
{{ end }}

Expand Down Expand Up @@ -105,6 +109,7 @@ protocol bgp {{ UniqueProtocolName $peer.ProtocolName $af $peer.ASN }} {
{{ if BoolDeref $peer.FilterIRR }}
if (net ~ AS{{ $peer.ASN }}_{{ $peer.ProtocolName }}_PFX_v{{ $af }}) then { accept; } else { _reject("not in IRR prefix set"); }
{{ end }}

{{ StrDeref $peer.PreImportFinal }}
accept;
};
Expand Down

0 comments on commit e8a44c8

Please sign in to comment.