diff options
author | ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp> | 2016-05-09 08:40:04 +0000 |
---|---|---|
committer | ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp> | 2016-05-09 08:40:04 +0000 |
commit | 5d7c1a00df4887558f261e2b284abed426aaa9db (patch) | |
tree | 0be3ba7e371be7b7a9a33a12a21e8782a5a70529 /config | |
parent | eda648181fa867a555cb7db6defc9a0c45ad0701 (diff) |
server: support afi-safi re-configuration
Adding or deleting supported afi-safis will immediately reset BGP sesssion.
Changing only prefix-limit configuration won't reset it.
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Diffstat (limited to 'config')
-rw-r--r-- | config/util.go | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/config/util.go b/config/util.go index 15a68305..d1696eb0 100644 --- a/config/util.go +++ b/config/util.go @@ -66,3 +66,19 @@ func GetAfiSafi(p *Neighbor, family bgp.RouteFamily) *AfiSafi { } return nil } + +func CheckAfiSafisChange(x, y []AfiSafi) bool { + if len(x) != len(y) { + return true + } + m := make(map[string]bool) + for _, e := range x { + m[string(e.Config.AfiSafiName)] = true + } + for _, e := range y { + if !m[string(e.Config.AfiSafiName)] { + return true + } + } + return false +} |