diff options
author | ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp> | 2015-08-17 17:28:18 +0900 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2015-08-19 13:29:33 +0900 |
commit | 856f867aea28dcee4d2f7b6d312cefe6808202de (patch) | |
tree | 7ff4ee7ff4ffa3b785b2f564d34ad7b89f09f610 /table/vrf.go | |
parent | 2f1e599c75b3954d798d16e6c924bc38fc61dbea (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/vrf.go')
-rw-r--r-- | table/vrf.go | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/table/vrf.go b/table/vrf.go index 3833ecac..4474b993 100644 --- a/table/vrf.go +++ b/table/vrf.go @@ -44,3 +44,14 @@ func (v *Vrf) ToApiStruct() *api.Vrf { ExportRt: f(v.ExportRt), } } + +func isLastTargetUser(vrfs map[string]*Vrf, target bgp.ExtendedCommunityInterface) bool { + for _, vrf := range vrfs { + for _, rt := range vrf.ImportRt { + if target.String() == rt.String() { + return false + } + } + } + return true +} |