diff options
author | Tahir Azim <tazim@amazon.com> | 2020-12-02 05:08:27 +0000 |
---|---|---|
committer | Tahir Azim <tahir.azim@gmail.com> | 2020-12-16 18:12:24 +1100 |
commit | 5aa7108d85b6926eca99978a2fb0e728176aae98 (patch) | |
tree | 42e6eeed7879c172378407ec4095490cd0f116c8 /internal/pkg/table/policy.go | |
parent | 066e791610596c9bb76cb15f1b3c91c1b620bc03 (diff) |
Enable IPv6 and IPv4 labeled prefixes to match against prefix set in policy
Diffstat (limited to 'internal/pkg/table/policy.go')
-rw-r--r-- | internal/pkg/table/policy.go | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/internal/pkg/table/policy.go b/internal/pkg/table/policy.go index d2e4f5ef..f4bcf0a4 100644 --- a/internal/pkg/table/policy.go +++ b/internal/pkg/table/policy.go @@ -1439,7 +1439,10 @@ func (c *PrefixCondition) Option() MatchOption { // subsequent comparison is skipped if that matches the conditions. // If PrefixList's length is zero, return true. func (c *PrefixCondition) Evaluate(path *Path, _ *PolicyOptions) bool { - if path.GetRouteFamily() != c.set.family { + pathAfi, _ := bgp.RouteFamilyToAfiSafi(path.GetRouteFamily()) + cAfi, _ := bgp.RouteFamilyToAfiSafi(c.set.family) + + if cAfi != pathAfi { return false } |