From 856f867aea28dcee4d2f7b6d312cefe6808202de Mon Sep 17 00:00:00 2001 From: ISHIDA Wataru Date: Mon, 17 Aug 2015 17:28:18 +0900 Subject: vrf: withdraw route-target constraint routes when deleting a vrf another partial implementation of RFC4686 Signed-off-by: ISHIDA Wataru --- table/table_manager.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'table/table_manager.go') 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 } -- cgit v1.2.3