diff options
author | Antoine Eiche <antoine.eiche@cloudwatt.com> | 2016-06-08 14:02:31 +0000 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2016-06-09 13:13:06 +0900 |
commit | 370f4ba1f03a52ffb6ecea2bfd56feb86b7c537f (patch) | |
tree | a9122be189ab1f3bd87d58face4792d2ae425281 /packet/bgp | |
parent | 3d89b9245a6ccaa160de2e10c3ec57f966d62e2c (diff) |
collector: use AddrPrefixInterface.Flat to generate Prefix
The tag NLRI is also added to the update table.
Diffstat (limited to 'packet/bgp')
-rw-r--r-- | packet/bgp/bgp.go | 5 |
1 files changed, 4 insertions, 1 deletions
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 { |