diff options
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 |