summaryrefslogtreecommitdiffhomepage
path: root/internal/pkg/config
diff options
context:
space:
mode:
Diffstat (limited to 'internal/pkg/config')
-rw-r--r--internal/pkg/config/default.go9
1 files changed, 5 insertions, 4 deletions
diff --git a/internal/pkg/config/default.go b/internal/pkg/config/default.go
index 08f9f865..13e1267c 100644
--- a/internal/pkg/config/default.go
+++ b/internal/pkg/config/default.go
@@ -8,6 +8,7 @@ import (
"reflect"
"strconv"
+ "github.com/osrg/gobgp/internal/pkg/zebra"
"github.com/osrg/gobgp/pkg/packet/bgp"
"github.com/osrg/gobgp/pkg/packet/bmp"
"github.com/osrg/gobgp/pkg/packet/rtr"
@@ -400,10 +401,10 @@ func setDefaultConfigValuesWithViper(v *viper.Viper, b *BgpConfigSet) error {
if b.Zebra.Config.Url == "" {
b.Zebra.Config.Url = "unix:/var/run/quagga/zserv.api"
}
- if b.Zebra.Config.Version < 2 {
- b.Zebra.Config.Version = 2
- } else if b.Zebra.Config.Version > 6 {
- b.Zebra.Config.Version = 6
+ if b.Zebra.Config.Version < zebra.MinZapiVer {
+ b.Zebra.Config.Version = zebra.MinZapiVer
+ } else if b.Zebra.Config.Version > zebra.MaxZapiVer {
+ b.Zebra.Config.Version = zebra.MaxZapiVer
}
if !v.IsSet("zebra.config.nexthop-trigger-enable") && !b.Zebra.Config.NexthopTriggerEnable && b.Zebra.Config.Version > 2 {
b.Zebra.Config.NexthopTriggerEnable = true