summaryrefslogtreecommitdiffhomepage
path: root/gobgpd
diff options
context:
space:
mode:
authorISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>2016-01-23 20:54:23 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2016-02-10 23:35:41 -0800
commitb19bbd415e8d33f01bcd407baece94ea1b81c957 (patch)
treee2a2ebec25d13924dfc7411ad25759c951dd70f8 /gobgpd
parenta207c90fe4544caa95d30ffaec5defee78ef6fd3 (diff)
gobgpd: support graceful-restart restarting-speaker behavior
use `-r` option to start gobgpd in restarting-speaker mode Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Diffstat (limited to 'gobgpd')
-rw-r--r--gobgpd/main.go28
1 files changed, 18 insertions, 10 deletions
diff --git a/gobgpd/main.go b/gobgpd/main.go
index ca950d29..dd12fec6 100644
--- a/gobgpd/main.go
+++ b/gobgpd/main.go
@@ -38,16 +38,17 @@ func main() {
signal.Notify(sigCh, syscall.SIGHUP, syscall.SIGTERM)
var opts struct {
- ConfigFile string `short:"f" long:"config-file" description:"specifying a config file"`
- ConfigType string `short:"t" long:"config-type" description:"specifying config type (toml, yaml, json)" default:"toml"`
- LogLevel string `short:"l" long:"log-level" description:"specifying log level"`
- LogPlain bool `short:"p" long:"log-plain" description:"use plain format for logging (json by default)"`
- UseSyslog string `short:"s" long:"syslog" description:"use syslogd"`
- Facility string `long:"syslog-facility" description:"specify syslog facility"`
- DisableStdlog bool `long:"disable-stdlog" description:"disable standard logging"`
- CPUs int `long:"cpus" description:"specify the number of CPUs to be used"`
- Ops bool `long:"openswitch" description:"openswitch mode"`
- GrpcPort int `long:"grpc-port" description:"grpc port" default:"50051"`
+ ConfigFile string `short:"f" long:"config-file" description:"specifying a config file"`
+ ConfigType string `short:"t" long:"config-type" description:"specifying config type (toml, yaml, json)" default:"toml"`
+ LogLevel string `short:"l" long:"log-level" description:"specifying log level"`
+ LogPlain bool `short:"p" long:"log-plain" description:"use plain format for logging (json by default)"`
+ UseSyslog string `short:"s" long:"syslog" description:"use syslogd"`
+ Facility string `long:"syslog-facility" description:"specify syslog facility"`
+ DisableStdlog bool `long:"disable-stdlog" description:"disable standard logging"`
+ CPUs int `long:"cpus" description:"specify the number of CPUs to be used"`
+ Ops bool `long:"openswitch" description:"openswitch mode"`
+ GrpcPort int `short:"g" long:"grpc-port" description:"grpc port" default:"50051"`
+ GracefulRestart bool `short:"r" long:"graceful-restart" description:"flag restart-state in graceful-restart capability"`
}
_, err := flags.Parse(&opts)
if err != nil {
@@ -187,6 +188,13 @@ func main() {
bgpConfig = &newConfig.Bgp
bgpServer.SetRpkiConfig(newConfig.Bgp.RpkiServers)
added = newConfig.Bgp.Neighbors
+ if opts.GracefulRestart {
+ for i, n := range added {
+ if n.GracefulRestart.Config.Enabled {
+ added[i].GracefulRestart.State.LocalRestarting = true
+ }
+ }
+ }
deleted = []config.Neighbor{}
updated = []config.Neighbor{}
} else {