summaryrefslogtreecommitdiffhomepage
path: root/table
diff options
context:
space:
mode:
Diffstat (limited to 'table')
-rw-r--r--table/adj.go13
-rw-r--r--table/destination.go8
-rw-r--r--table/table_manager.go12
3 files changed, 33 insertions, 0 deletions
diff --git a/table/adj.go b/table/adj.go
index 5e685f2e..8aa40370 100644
--- a/table/adj.go
+++ b/table/adj.go
@@ -156,3 +156,16 @@ func (adj *AdjRib) StaleAll(rfList []bgp.RouteFamily) {
}
}
}
+
+func (adj *AdjRib) Exists(path *Path) bool {
+ if path == nil {
+ return false
+ }
+ family := path.GetRouteFamily()
+ table, ok := adj.table[family]
+ if !ok {
+ return false
+ }
+ _, ok = table[path.getPrefix()]
+ return ok
+}
diff --git a/table/destination.go b/table/destination.go
index 91d2d89b..e02c7686 100644
--- a/table/destination.go
+++ b/table/destination.go
@@ -254,6 +254,14 @@ func (dest *Destination) Calculate(ids []string) (map[string]*Path, []*Path) {
}()
best := dest.GetBestPath(id)
if best != nil && best.Equal(old) {
+ // RFC4684 3.2. Intra-AS VPN Route Distribution
+ // When processing RT membership NLRIs received from internal iBGP
+ // peers, it is necessary to consider all available iBGP paths for a
+ // given RT prefix, for building the outbound route filter, and not just
+ // the best path.
+ if best.GetRouteFamily() == bgp.RF_RTC_UC {
+ return best
+ }
return nil
}
if best == nil {
diff --git a/table/table_manager.go b/table/table_manager.go
index a041c5b9..cc9784b9 100644
--- a/table/table_manager.go
+++ b/table/table_manager.go
@@ -358,3 +358,15 @@ func (manager *TableManager) GetPathList(id string, rfList []bgp.RouteFamily) []
}
return paths
}
+
+func (manager *TableManager) GetDestination(path *Path) *Destination {
+ if path == nil {
+ return nil
+ }
+ family := path.GetRouteFamily()
+ t, ok := manager.Tables[family]
+ if !ok {
+ return nil
+ }
+ return t.GetDestination(path.getPrefix())
+}