summaryrefslogtreecommitdiffhomepage
path: root/config/default.go
diff options
context:
space:
mode:
authorISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>2015-10-22 23:41:41 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2016-02-10 22:15:04 -0800
commit9861b237685d420ff390b5338da94396f7cc5274 (patch)
tree90d327e55ec7e9d4fc0c218f0104fd2166b62cdc /config/default.go
parent36f8911cee2557a0065ee291d03a6c6d88b537c0 (diff)
config: set default value related to graceful restart
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Diffstat (limited to 'config/default.go')
-rw-r--r--config/default.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/config/default.go b/config/default.go
index 90b7b2ff..1d29ec4d 100644
--- a/config/default.go
+++ b/config/default.go
@@ -138,6 +138,15 @@ func SetDefaultConfigValues(v *viper.Viper, b *Bgp) error {
n.Config.PeerType = PEER_TYPE_INTERNAL
}
}
+
+ if n.GracefulRestart.Config.Enabled {
+ if !vv.IsSet("neighbor.graceful-restart.config.restart-time") {
+ // RFC 4724 4. Operation
+ // A suggested default for the Restart Time is a value less than or
+ // equal to the HOLDTIME carried in the OPEN.
+ n.GracefulRestart.Config.RestartTime = uint16(n.Timers.Config.HoldTime)
+ }
+ }
b.Neighbors[idx] = n
}