summaryrefslogtreecommitdiffhomepage
path: root/table
diff options
context:
space:
mode:
authorFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2018-05-02 09:53:18 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2018-05-07 21:18:04 +0900
commitcc42a3137cd8d09521b6776ba0f1d76c186f4713 (patch)
treee7b3703fc2d0104576ea471947275059207824b3 /table
parenta3ffcfac5b403e22d307ff58e2c6377d40a07720 (diff)
table: remove Radixkey member in Destination structure
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Diffstat (limited to 'table')
-rw-r--r--table/destination.go5
-rw-r--r--table/table.go4
2 files changed, 2 insertions, 7 deletions
diff --git a/table/destination.go b/table/destination.go
index 44f65e7f..84183002 100644
--- a/table/destination.go
+++ b/table/destination.go
@@ -169,7 +169,6 @@ type Destination struct {
routeFamily bgp.RouteFamily
nlri bgp.AddrPrefixInterface
knownPathList []*Path
- RadixKey string
localIdMap *Bitmap
}
@@ -184,10 +183,6 @@ func NewDestination(nlri bgp.AddrPrefixInterface, mapSize int, known ...*Path) *
if mapSize != 0 {
d.localIdMap.Flag(0)
}
- switch d.routeFamily {
- case bgp.RF_IPv4_UC, bgp.RF_IPv6_UC, bgp.RF_IPv4_MPLS, bgp.RF_IPv6_MPLS:
- d.RadixKey = AddrToRadixkey(nlri)
- }
return d
}
diff --git a/table/table.go b/table/table.go
index 6bc88149..35403a23 100644
--- a/table/table.go
+++ b/table/table.go
@@ -200,7 +200,7 @@ func (t *Table) GetSortedDestinations() []*Destination {
case bgp.RF_IPv4_UC, bgp.RF_IPv6_UC:
r := radix.New()
for _, dst := range t.GetDestinations() {
- r.Insert(dst.RadixKey, dst)
+ r.Insert(AddrToRadixkey(dst.nlri), dst)
}
r.Walk(func(s string, v interface{}) bool {
results = append(results, v.(*Destination))
@@ -241,7 +241,7 @@ func (t *Table) GetLongerPrefixDestinations(key string) ([]*Destination, error)
k := CidrToRadixkey(prefix.String())
r := radix.New()
for _, dst := range t.GetDestinations() {
- r.Insert(dst.RadixKey, dst)
+ r.Insert(AddrToRadixkey(dst.nlri), dst)
}
r.WalkPrefix(k, func(s string, v interface{}) bool {
results = append(results, v.(*Destination))