diff options
author | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2016-05-31 17:55:08 +0900 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2016-05-31 17:55:08 +0900 |
commit | ec4e7a755f4ef11d0206f3fe905d3eecbed2533b (patch) | |
tree | d5070ebdf5593f68852141a679bb409697398827 | |
parent | 63befebdf88e599174b4e19a48acc2d18bdfcb2a (diff) |
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 <fujita.tomonori@lab.ntt.co.jp>
-rw-r--r-- | server/server.go | 10 |
1 files changed, 10 insertions, 0 deletions
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 { |