summaryrefslogtreecommitdiffhomepage
path: root/cmd/gobgpd/main.go
diff options
context:
space:
mode:
authorCarl Baldwin <carl@ecbaldwin.net>2019-07-24 09:01:23 -0600
committerFUJITA Tomonori <fujita.tomonori@gmail.com>2019-08-28 09:06:20 +0900
commit02863c581d653fd4bedcfd0da991e27943c95149 (patch)
tree8bc681460d33de46defcee517e46a68df6d580d8 /cmd/gobgpd/main.go
parent72094dfceeaa083e1e59ed9a64dc12cede4ad43e (diff)
Move assignement of current config to the end
Now that `c` is no longer referenced in the block above, its assignement can be moved to later. This allows consolidating the two assignements into one and moving them to the very end to magic the logic clearer.
Diffstat (limited to 'cmd/gobgpd/main.go')
-rw-r--r--cmd/gobgpd/main.go3
1 files changed, 1 insertions, 2 deletions
diff --git a/cmd/gobgpd/main.go b/cmd/gobgpd/main.go
index 569c2daa..8abcc072 100644
--- a/cmd/gobgpd/main.go
+++ b/cmd/gobgpd/main.go
@@ -236,7 +236,6 @@ func main() {
var updatePolicy bool
if c == nil {
- c = newConfig
if err := bgpServer.StartBgp(context.Background(), &api.StartBgpRequest{
Global: config.NewGlobalFromConfigStruct(&newConfig.Global),
}); err != nil {
@@ -372,7 +371,6 @@ func main() {
assignGlobalpolicy(bgpServer, &newConfig.Global.ApplyPolicy.Config)
updatePolicy = true
}
- c = newConfig
}
for _, pg := range addedPg {
log.Infof("PeerGroup %s is added", pg.Config.PeerGroupName)
@@ -447,6 +445,7 @@ func main() {
log.Warn(err)
}
}
+ c = newConfig
}
}
}