From b7fdd154bda831f3217c702fab1e703fc91d7c75 Mon Sep 17 00:00:00 2001 From: IWASE Yusuke Date: Mon, 11 Sep 2017 13:28:21 +0900 Subject: config: Default TTL for ebgp-multihop and ttl-security Signed-off-by: IWASE Yusuke --- config/default.go | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'config/default.go') 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 -- cgit v1.2.3