From ec4e7a755f4ef11d0206f3fe905d3eecbed2533b Mon Sep 17 00:00:00 2001 From: FUJITA Tomonori Date: Tue, 31 May 2016 17:55:08 +0900 Subject: server: avoid sending unnecessary udate messages with soft_reset_in for route server The current code sets a path to table.POLICY_DIRECTION_NONE, which is still rib's knowPathList. Next time the best path selection happens, the path is moved to oldKnownPathList and wrongly the best path selection code could assume that it was the old best path, and sends an unnecessary update message. Signed-off-by: FUJITA Tomonori --- server/server.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/server/server.go b/server/server.go index 7c9a89e8..73ac5ad1 100644 --- a/server/server.go +++ b/server/server.go @@ -2029,6 +2029,16 @@ func (server *BgpServer) handleGrpc(grpcReq *GrpcRequest) []*SenderMsg { path.Filter(peer.ID(), table.POLICY_DIRECTION_NONE) if server.policy.ApplyPolicy(peer.ID(), table.POLICY_DIRECTION_IN, path, nil) != nil { pathList = append(pathList, path.Clone(false)) + // this path still in rib's + // knownPathList. We can't + // drop + // table.POLICY_DIRECTION_IMPORT + // flag here. Otherwise, this + // path could be the old best + // path. + if peer.isRouteServerClient() { + path.Filter(peer.ID(), table.POLICY_DIRECTION_IMPORT) + } } else { path.Filter(peer.ID(), table.POLICY_DIRECTION_IN) if exResult != table.POLICY_DIRECTION_IN { -- cgit v1.2.3