summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorIWASE Yusuke <iwase.yusuke0@gmail.com>2017-09-11 13:28:21 +0900
committerIWASE Yusuke <iwase.yusuke0@gmail.com>2017-09-11 13:31:18 +0900
commitb7fdd154bda831f3217c702fab1e703fc91d7c75 (patch)
tree8cc667bdf5442d07b1c5055af0f89556176310ad
parentb0cd149707fdf32beaa453f0fbb879e618216815 (diff)
config: Default TTL for ebgp-multihop and ttl-security
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
-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