diff options
author | Marcin Ptaszynski <marcin.ptaszynski@ntti3.io> | 2018-07-12 17:13:15 -0700 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2018-08-17 16:50:18 +0900 |
commit | 08cd29ea36dffc21b9cead996254e5535868c71f (patch) | |
tree | 98884b8acd3b2c45c5887cc3c868a8990f2f1ec5 /internal | |
parent | 540ee758f07696cfc5f35127dd11dfcd103ebd50 (diff) |
ignore duplicate RTC Membership announcements
Diffstat (limited to 'internal')
-rw-r--r-- | internal/pkg/table/table_manager.go | 18 |
1 files changed, 16 insertions, 2 deletions
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 |