diff options
author | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2015-08-05 15:48:25 +0900 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2015-08-05 17:25:12 +0900 |
commit | 0b5bb073128b3000f383927a997d4a40d274f569 (patch) | |
tree | 27dfee4b4f436857e91ff549635e8ced5ff61c25 /gobgpd | |
parent | 0d14f7dca2f77f661e4baaaa9d85ff3d0967fe34 (diff) |
fix policy dynamic update
handle dynamic policy peer binding
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Diffstat (limited to 'gobgpd')
-rw-r--r-- | gobgpd/main.go | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/gobgpd/main.go b/gobgpd/main.go index cf327f61..7a3b3ef2 100644 --- a/gobgpd/main.go +++ b/gobgpd/main.go @@ -167,14 +167,16 @@ func main() { case newConfig := <-configCh: var added []config.Neighbor var deleted []config.Neighbor + var updated []config.Neighbor if bgpConfig == nil { bgpServer.SetGlobalType(newConfig.Bgp.Global) bgpConfig = &newConfig.Bgp added = newConfig.Bgp.Neighbors.NeighborList deleted = []config.Neighbor{} + updated = []config.Neighbor{} } else { - bgpConfig, added, deleted = config.UpdateConfig(bgpConfig, &newConfig.Bgp) + bgpConfig, added, deleted, updated = config.UpdateConfig(bgpConfig, &newConfig.Bgp) } if policyConfig == nil { @@ -195,6 +197,10 @@ func main() { log.Infof("Peer %v is deleted", p.NeighborConfig.NeighborAddress) bgpServer.PeerDelete(p) } + for _, p := range updated { + log.Infof("Peer %v is updated", p.NeighborConfig.NeighborAddress) + bgpServer.PeerUpdate(p) + } case sig := <-sigCh: switch sig { case syscall.SIGHUP: |