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 /pkg/server/server.go | |
parent | 540ee758f07696cfc5f35127dd11dfcd103ebd50 (diff) |
ignore duplicate RTC Membership announcements
Diffstat (limited to 'pkg/server/server.go')
-rw-r--r-- | pkg/server/server.go | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/pkg/server/server.go b/pkg/server/server.go index c4177ab0..472da9ad 100644 --- a/pkg/server/server.go +++ b/pkg/server/server.go @@ -24,17 +24,16 @@ import ( "sync" "time" - api "github.com/osrg/gobgp/api" + "github.com/eapache/channels" + uuid "github.com/satori/go.uuid" + log "github.com/sirupsen/logrus" + api "github.com/osrg/gobgp/api" "github.com/osrg/gobgp/internal/pkg/apiutil" "github.com/osrg/gobgp/internal/pkg/config" "github.com/osrg/gobgp/internal/pkg/table" "github.com/osrg/gobgp/internal/pkg/zebra" "github.com/osrg/gobgp/pkg/packet/bgp" - - "github.com/eapache/channels" - uuid "github.com/satori/go.uuid" - log "github.com/sirupsen/logrus" ) type TCPListener struct { @@ -987,7 +986,19 @@ func (server *BgpServer) propagateUpdate(peer *Peer, pathList []*table.Path) { // given RT on RTM NLRI is already removed from adj-RIB-in. _, candidates = server.getBestFromLocal(peer, fs) } else { - candidates = server.globalRib.GetBestPathList(peer.TableID(), 0, fs) + // https://github.com/osrg/gobgp/issues/1777 + // Ignore duplicate Membership announcements + membershipsForSource := server.globalRib.GetPathListWithSource(table.GLOBAL_RIB_NAME, []bgp.RouteFamily{bgp.RF_RTC_UC}, path.GetSource()) + found := false + for _, membership := range membershipsForSource { + if membership.GetNlri().(*bgp.RouteTargetMembershipNLRI).RouteTarget.String() == rt.String() { + found = true + break + } + } + if !found { + candidates = server.globalRib.GetBestPathList(peer.TableID(), 0, fs) + } } paths := make([]*table.Path, 0, len(candidates)) for _, p := range candidates { |