summaryrefslogtreecommitdiffhomepage
path: root/config/default.go
diff options
context:
space:
mode:
Diffstat (limited to 'config/default.go')
-rw-r--r--config/default.go13
1 files changed, 11 insertions, 2 deletions
diff --git a/config/default.go b/config/default.go
index 810168e7..29e337e9 100644
--- a/config/default.go
+++ b/config/default.go
@@ -240,8 +240,17 @@ func setDefaultNeighborConfigValuesWithViper(v *viper.Viper, n *Neighbor, asn ui
}
}
- if n.EbgpMultihop.Config.Enabled && n.TtlSecurity.Config.Enabled {
- return fmt.Errorf("ebgp-multihop and ttl-security are mututally exclusive")
+ if n.EbgpMultihop.Config.Enabled {
+ if n.TtlSecurity.Config.Enabled {
+ return fmt.Errorf("ebgp-multihop and ttl-security are mututally exclusive")
+ }
+ if n.EbgpMultihop.Config.MultihopTtl == 0 {
+ n.EbgpMultihop.Config.MultihopTtl = 255
+ }
+ } else if n.TtlSecurity.Config.Enabled {
+ if n.TtlSecurity.Config.TtlMin == 0 {
+ n.TtlSecurity.Config.TtlMin = 255
+ }
}
return nil