From 370f4ba1f03a52ffb6ecea2bfd56feb86b7c537f Mon Sep 17 00:00:00 2001 From: Antoine Eiche Date: Wed, 8 Jun 2016 14:02:31 +0000 Subject: collector: use AddrPrefixInterface.Flat to generate Prefix The tag NLRI is also added to the update table. --- packet/bgp/bgp.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'packet') diff --git a/packet/bgp/bgp.go b/packet/bgp/bgp.go index c01859fe..17d11f4e 100644 --- a/packet/bgp/bgp.go +++ b/packet/bgp/bgp.go @@ -7081,9 +7081,12 @@ func (e *MessageError) Error() string { } func (l *LabeledVPNIPAddrPrefix) Flat() map[string]string { + prefixLen := l.IPAddrPrefixDefault.Length - uint8(8*(l.Labels.Len()+l.RD.Len())) return map[string]string{ "Prefix": l.IPAddrPrefixDefault.Prefix.String(), - "PrefixLen": string(l.IPAddrPrefixDefault.Length - uint8(8*(l.Labels.Len()+l.RD.Len())))} + "PrefixLen": fmt.Sprintf("%d", prefixLen), + "NLRI": l.String(), + } } func (p *IPAddrPrefixDefault) Flat() map[string]string { -- cgit v1.2.3