From 345b848330b30e002455715146491ffc5291b025 Mon Sep 17 00:00:00 2001 From: Eiichiro Watanabe Date: Thu, 8 Nov 2018 15:26:00 +0900 Subject: server: Fix some values are all off by one in MRT TABLEDUMP_V2 --- pkg/server/mrt.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/server/mrt.go b/pkg/server/mrt.go index fae9b5cc..b4fe30b5 100644 --- a/pkg/server/mrt.go +++ b/pkg/server/mrt.go @@ -137,12 +137,12 @@ func (m *mrtWriter) loop() error { } idx := func(p *table.Path) uint16 { - for i, pconf := range e.Neighbor { - if p.GetSource().Address.String() == pconf.State.NeighborAddress { + for i, peer := range peers { + if peer.IpAddress.String() == p.GetSource().Address.String() { return uint16(i) } } - return uint16(len(e.Neighbor)) + return uint16(len(peers)) } subtype := func(p *table.Path, isAddPath bool) mrt.MRTSubTypeTableDumpv2 { -- cgit v1.2.3