From 08cd29ea36dffc21b9cead996254e5535868c71f Mon Sep 17 00:00:00 2001 From: Marcin Ptaszynski Date: Thu, 12 Jul 2018 17:13:15 -0700 Subject: ignore duplicate RTC Membership announcements --- internal/pkg/table/table_manager.go | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'internal/pkg') diff --git a/internal/pkg/table/table_manager.go b/internal/pkg/table/table_manager.go index e10f4d6a..2640f622 100644 --- a/internal/pkg/table/table_manager.go +++ b/internal/pkg/table/table_manager.go @@ -21,10 +21,10 @@ import ( "net" "time" - "github.com/osrg/gobgp/pkg/packet/bgp" - farm "github.com/dgryski/go-farm" log "github.com/sirupsen/logrus" + + "github.com/osrg/gobgp/pkg/packet/bgp" ) const ( @@ -335,6 +335,20 @@ func (manager *TableManager) GetPathListWithNexthop(id string, rfList []bgp.Rout return paths } +func (manager *TableManager) GetPathListWithSource(id string, rfList []bgp.RouteFamily, source *PeerInfo) []*Path { + paths := make([]*Path, 0, manager.getDestinationCount(rfList)) + for _, rf := range rfList { + if t, ok := manager.Tables[rf]; ok { + for _, path := range t.GetKnownPathList(id, 0) { + if path.GetSource().Equal(source) { + paths = append(paths, path) + } + } + } + } + return paths +} + func (manager *TableManager) GetDestination(path *Path) *Destination { if path == nil { return nil -- cgit v1.2.3