summaryrefslogtreecommitdiffhomepage
path: root/table
diff options
context:
space:
mode:
authorISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>2017-07-04 14:24:57 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2017-07-04 14:24:57 +0900
commit454fd93ef707c530b3ece04ef4727ad1f7371d4b (patch)
tree379ef72e0b04fcc5bb913c435f162bdeaf5fcbdc /table
parent1d46f58ff1df4d1195091a9f25e74a583801b39d (diff)
support addpath recv
Diffstat (limited to 'table')
-rw-r--r--table/adj.go3
-rw-r--r--table/destination.go6
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(),