summaryrefslogtreecommitdiffhomepage
path: root/table
diff options
context:
space:
mode:
Diffstat (limited to 'table')
-rw-r--r--table/adj.go19
-rw-r--r--table/table_manager_test.go2
2 files changed, 8 insertions, 13 deletions
diff --git a/table/adj.go b/table/adj.go
index a58f87aa..8d298be4 100644
--- a/table/adj.go
+++ b/table/adj.go
@@ -21,22 +21,20 @@ import (
)
type AdjRib struct {
- id string
- accepted map[bgp.RouteFamily]int
- table map[bgp.RouteFamily]map[string]*Path
- isCollector bool
+ id string
+ accepted map[bgp.RouteFamily]int
+ table map[bgp.RouteFamily]map[string]*Path
}
-func NewAdjRib(id string, rfList []bgp.RouteFamily, isCollector bool) *AdjRib {
+func NewAdjRib(id string, rfList []bgp.RouteFamily) *AdjRib {
table := make(map[bgp.RouteFamily]map[string]*Path)
for _, rf := range rfList {
table[rf] = make(map[string]*Path)
}
return &AdjRib{
- id: id,
- table: table,
- accepted: make(map[bgp.RouteFamily]int),
- isCollector: isCollector,
+ id: id,
+ table: table,
+ accepted: make(map[bgp.RouteFamily]int),
}
}
@@ -47,9 +45,6 @@ func (adj *AdjRib) Update(pathList []*Path) {
}
rf := path.GetRouteFamily()
key := path.getPrefix()
- if adj.isCollector {
- key += path.GetSource().Address.String()
- }
old, found := adj.table[rf][key]
if path.IsWithdraw {
diff --git a/table/table_manager_test.go b/table/table_manager_test.go
index 8b072c44..193890f3 100644
--- a/table/table_manager_test.go
+++ b/table/table_manager_test.go
@@ -2127,7 +2127,7 @@ func TestProcessBGPUpdate_Timestamp(t *testing.T) {
nlri := []*bgp.IPAddrPrefix{bgp.NewIPAddrPrefix(24, "10.10.10.0")}
- adjRib := NewAdjRib("test", []bgp.RouteFamily{bgp.RF_IPv4_UC, bgp.RF_IPv6_UC}, false)
+ adjRib := NewAdjRib("test", []bgp.RouteFamily{bgp.RF_IPv4_UC, bgp.RF_IPv6_UC})
m1 := bgp.NewBGPUpdateMessage(nil, pathAttributes, nlri)
peer := peerR1()
pList1 := ProcessMessage(m1, peer, time.Now())