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/path.go | |
parent | 066e791610596c9bb76cb15f1b3c91c1b620bc03 (diff) |
Enable IPv6 and IPv4 labeled prefixes to match against prefix set in policy
Diffstat (limited to 'internal/pkg/table/path.go')
-rw-r--r-- | internal/pkg/table/path.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/internal/pkg/table/path.go b/internal/pkg/table/path.go index 805fa63c..15fcfa05 100644 --- a/internal/pkg/table/path.go +++ b/internal/pkg/table/path.go @@ -1233,12 +1233,12 @@ func nlriToIPNet(nlri bgp.AddrPrefixInterface) *net.IPNet { case *bgp.LabeledIPAddrPrefix: return &net.IPNet{ IP: net.IP(T.Prefix.To4()), - Mask: net.CIDRMask(int(T.Length), 32), + Mask: net.CIDRMask(int(T.Length)-T.Labels.Len()*8, 32), } case *bgp.LabeledIPv6AddrPrefix: return &net.IPNet{ - IP: net.IP(T.Prefix.To4()), - Mask: net.CIDRMask(int(T.Length), 128), + IP: net.IP(T.Prefix.To16()), + Mask: net.CIDRMask(int(T.Length)-T.Labels.Len()*8, 128), } } return nil |