summaryrefslogtreecommitdiffhomepage
path: root/server/server.go
diff options
context:
space:
mode:
authorFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2016-04-22 16:10:02 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2016-04-22 16:10:02 +0900
commit0c58e348de62bf156582417a6b9d726dd4fe116e (patch)
tree5eda02dea40ee09cd0feccdb194101d2c78799ba /server/server.go
parenta34d8d2651877998fe01d35350259c979a49d295 (diff)
server: sending SOFT_RESET_IN on all the peer after the policy changes with config file
Apply the new policies (in and import) to the existing routes. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Diffstat (limited to 'server/server.go')
-rw-r--r--server/server.go15
1 files changed, 15 insertions, 0 deletions
diff --git a/server/server.go b/server/server.go
index c13436de..f44f2123 100644
--- a/server/server.go
+++ b/server/server.go
@@ -1126,6 +1126,21 @@ func (server *BgpServer) Shutdown() {
func (server *BgpServer) UpdatePolicy(policy config.RoutingPolicy) {
server.policyUpdateCh <- policy
+ // TODO: we want to apply the new policies to the existing
+ // routes here. Sending SOFT_RESET_IN to all the peers works
+ // for the change of in and import policies. SOFT_RESET_OUT is
+ // necessary for the export policy but we can't blindly
+ // execute SOFT_RESET_OUT because we unnecessarily advertize
+ // the existing routes. Needs to investigate the changes of
+ // policies and handle only affected peers.
+
+ ch := make(chan *GrpcResponse)
+ server.GrpcReqCh <- &GrpcRequest{
+ RequestType: REQ_NEIGHBOR_SOFT_RESET_IN,
+ Name: "all",
+ ResponseCh: ch,
+ }
+ <-ch
}
func (server *BgpServer) setPolicyByConfig(id string, c config.ApplyPolicy) {