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 <[email protected]>
This commit is contained in:
FUJITA Tomonori
2016-05-31 17:55:08 +09:00
parent 63befebdf8
commit ec4e7a755f
+10
View File
@@ -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 {