diff --git a/pkg/packet/bgp/bgp.go b/pkg/packet/bgp/bgp.go index fad11c1f4..5c7d051bc 100644 --- a/pkg/packet/bgp/bgp.go +++ b/pkg/packet/bgp/bgp.go @@ -5694,7 +5694,7 @@ func NewLsPrefixTLVs(pd *LsPrefixDescriptor) []LsTLVInterface { Length: lenIpReach, }, PrefixLength: uint8(prefixSize), - Prefix: []byte(ip)[:((lenIpPrefix-1)/8 + 1)], + Prefix: []byte(ip), } } else if ipReach.IP.To16() != nil { ip := ipReach.IP.To16() @@ -5704,7 +5704,7 @@ func NewLsPrefixTLVs(pd *LsPrefixDescriptor) []LsTLVInterface { Length: lenIpReach, }, PrefixLength: uint8(prefixSize), - Prefix: []byte(ip)[:((lenIpPrefix-1)/8 + 1)], + Prefix: []byte(ip), } } lsTLVs = append(lsTLVs, tlv)