summaryrefslogtreecommitdiffhomepage
path: root/table/table_manager.go
diff options
context:
space:
mode:
authorISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>2015-08-17 17:28:18 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2015-08-19 13:29:33 +0900
commit856f867aea28dcee4d2f7b6d312cefe6808202de (patch)
tree7ff4ee7ff4ffa3b785b2f564d34ad7b89f09f610 /table/table_manager.go
parent2f1e599c75b3954d798d16e6c924bc38fc61dbea (diff)
vrf: withdraw route-target constraint routes when deleting a vrf
another partial implementation of RFC4686 Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Diffstat (limited to 'table/table_manager.go')
-rw-r--r--table/table_manager.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/table/table_manager.go b/table/table_manager.go
index b6295498..75b68b03 100644
--- a/table/table_manager.go
+++ b/table/table_manager.go
@@ -155,7 +155,7 @@ func (manager *TableManager) AddVrf(name string, rd bgp.RouteDistinguisherInterf
nexthop := "0.0.0.0"
for _, target := range importRt {
nlri := bgp.NewRouteTargetMembershipNLRI(info.AS, target)
- pattr := make([]bgp.PathAttributeInterface, 0)
+ pattr := make([]bgp.PathAttributeInterface, 0, 2)
pattr = append(pattr, bgp.NewPathAttributeOrigin(bgp.BGP_ORIGIN_ATTR_TYPE_IGP))
pattr = append(pattr, bgp.NewPathAttributeMpReachNLRI(nexthop, []bgp.AddrPrefixInterface{nlri}))
msgs = append(msgs, NewPath(info, nlri, false, pattr, false, time.Now(), false))
@@ -180,6 +180,8 @@ func (manager *TableManager) DeleteVrf(name string) ([]*Path, error) {
"ExportRt": vrf.ExportRt,
}).Debugf("delete vrf")
delete(manager.Vrfs, name)
+ rtcTable := manager.Tables[bgp.RF_RTC_UC]
+ msgs = append(msgs, rtcTable.deleteRTCPathsByVrf(vrf, manager.Vrfs)...)
return msgs, nil
}