diff options
author | ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp> | 2017-07-04 14:24:57 +0900 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2017-07-04 14:24:57 +0900 |
commit | 454fd93ef707c530b3ece04ef4727ad1f7371d4b (patch) | |
tree | 379ef72e0b04fcc5bb913c435f162bdeaf5fcbdc /table | |
parent | 1d46f58ff1df4d1195091a9f25e74a583801b39d (diff) |
support addpath recv
Diffstat (limited to 'table')
-rw-r--r-- | table/adj.go | 3 | ||||
-rw-r--r-- | table/destination.go | 6 |
2 files changed, 5 insertions, 4 deletions
diff --git a/table/adj.go b/table/adj.go index 5ef540f6..05a795be 100644 --- a/table/adj.go +++ b/table/adj.go @@ -17,6 +17,7 @@ package table import ( "fmt" + "github.com/osrg/gobgp/packet/bgp" ) @@ -44,7 +45,7 @@ func (adj *AdjRib) Update(pathList []*Path) { continue } rf := path.GetRouteFamily() - key := path.getPrefix() + key := fmt.Sprintf("%d:%s", path.GetNlri().PathIdentifier(), path.getPrefix()) old, found := adj.table[rf][key] if path.IsWithdraw { diff --git a/table/destination.go b/table/destination.go index 6f4f95ad..cef2086f 100644 --- a/table/destination.go +++ b/table/destination.go @@ -378,8 +378,8 @@ func (dest *Destination) explicitWithdraw() paths { for _, withdraw := range dest.withdrawList { isFound := false for _, path := range dest.knownPathList { - // We have a match if the source are same. - if path.GetSource().Equal(withdraw.GetSource()) { + // We have a match if the source and path-id are same. + if path.GetSource().Equal(withdraw.GetSource()) && path.GetNlri().PathIdentifier() == withdraw.GetNlri().PathIdentifier() { isFound = true // this path is referenced in peer's adj-rib-in // when there was no policy modification applied. @@ -430,7 +430,7 @@ func (dest *Destination) implicitWithdraw() paths { // version num. as newPaths are implicit withdrawal of old // paths and when doing RouteRefresh (not EnhancedRouteRefresh) // we get same paths again. - if newPath.GetSource().Equal(path.GetSource()) { + if newPath.GetSource().Equal(path.GetSource()) && newPath.GetNlri().PathIdentifier() == path.GetNlri().PathIdentifier() { log.WithFields(log.Fields{ "Topic": "Table", "Key": dest.GetNlri().String(), |