summaryrefslogtreecommitdiffhomepage
path: root/table/table.go
diff options
context:
space:
mode:
Diffstat (limited to 'table/table.go')
-rw-r--r--table/table.go25
1 files changed, 25 insertions, 0 deletions
diff --git a/table/table.go b/table/table.go
index a5f867d4..3bc5bb3f 100644
--- a/table/table.go
+++ b/table/table.go
@@ -69,6 +69,31 @@ func (t *Table) DeleteDestByPeer(peerInfo *PeerInfo) []*Destination {
return changedDests
}
+func (t *Table) deletePathsByVrf(vrf *Vrf) []*Path {
+ pathList := make([]*Path, 0)
+ for _, dest := range t.destinations {
+ for _, p := range dest.GetKnownPathList() {
+ var rd bgp.RouteDistinguisherInterface
+ nlri := p.GetNlri()
+ switch nlri.(type) {
+ case *bgp.LabeledVPNIPAddrPrefix:
+ rd = nlri.(*bgp.LabeledVPNIPAddrPrefix).RD
+ case *bgp.LabeledVPNIPv6AddrPrefix:
+ rd = nlri.(*bgp.LabeledVPNIPv6AddrPrefix).RD
+ case *bgp.EVPNNLRI:
+ rd = nlri.(*bgp.EVPNNLRI).RD()
+ default:
+ return pathList
+ }
+ if p.IsLocal() && vrf.Rd.String() == rd.String() {
+ p.IsWithdraw = true
+ pathList = append(pathList, p)
+ }
+ }
+ }
+ return pathList
+}
+
func (t *Table) deleteDestByNlri(nlri bgp.AddrPrefixInterface) *Destination {
destinations := t.GetDestinations()
dest := destinations[t.tableKey(nlri)]