summaryrefslogtreecommitdiffhomepage
path: root/config/util.go
diff options
context:
space:
mode:
Diffstat (limited to 'config/util.go')
-rw-r--r--config/util.go16
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
+}