summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--config/default.go13
1 files changed, 11 insertions, 2 deletions
diff --git a/config/default.go b/config/default.go
index c3fa4eb3..5c472909 100644
--- a/config/default.go
+++ b/config/default.go
@@ -2,12 +2,13 @@ package config
import (
"fmt"
+ "net"
+ "reflect"
+
"github.com/osrg/gobgp/packet/bgp"
"github.com/osrg/gobgp/packet/bmp"
"github.com/osrg/gobgp/packet/rtr"
"github.com/spf13/viper"
- "net"
- "reflect"
)
const (
@@ -235,6 +236,14 @@ func setDefaultNeighborConfigValuesWithViper(v *viper.Viper, n *Neighbor, g *Glo
}
}
+ if n.RouteReflector.Config.RouteReflectorClient {
+ if n.RouteReflector.Config.RouteReflectorClusterId == "" {
+ n.RouteReflector.Config.RouteReflectorClusterId = RrClusterIdType(g.Config.RouterId)
+ } else if id := net.ParseIP(string(n.RouteReflector.Config.RouteReflectorClusterId)).To4(); id == nil {
+ return fmt.Errorf("route-reflector-cluster-id should be specified in IPv4 address format")
+ }
+ }
+
return nil
}