diff options
Diffstat (limited to 'server')
-rw-r--r-- | server/peer.go | 8 | ||||
-rw-r--r-- | server/server.go | 4 |
2 files changed, 9 insertions, 3 deletions
diff --git a/server/peer.go b/server/peer.go index 6f4f6992..0f6b37ec 100644 --- a/server/peer.go +++ b/server/peer.go @@ -166,7 +166,7 @@ func (peer *Peer) getBestFromLocal(rfList []bgp.RouteFamily) ([]*table.Path, []* return pathList, filtered } -func (peer *Peer) processOutgoingPaths(paths []*table.Path) []*table.Path { +func (peer *Peer) processOutgoingPaths(paths, withdrawals []*table.Path) []*table.Path { if peer.fsm.state != bgp.BGP_FSM_ESTABLISHED { return nil } @@ -179,6 +179,12 @@ func (peer *Peer) processOutgoingPaths(paths []*table.Path) []*table.Path { } outgoing := make([]*table.Path, 0, len(paths)) + for _, path := range withdrawals { + if path.IsLocal() { + outgoing = append(outgoing, path) + } + } + options := &table.PolicyOptions{ Neighbor: peer.fsm.peerInfo.Address, } diff --git a/server/server.go b/server/server.go index 71e569b2..cf6f3af9 100644 --- a/server/server.go +++ b/server/server.go @@ -477,7 +477,7 @@ func (server *BgpServer) dropPeerAllRoutes(peer *Peer, families []bgp.RouteFamil if peer.isRouteServerClient() != targetPeer.isRouteServerClient() || targetPeer == peer { continue } - if paths := targetPeer.processOutgoingPaths(best[targetPeer.TableID()]); len(paths) > 0 { + if paths := targetPeer.processOutgoingPaths(best[targetPeer.TableID()], nil); len(paths) > 0 { msgs = append(msgs, newSenderMsg(targetPeer, paths, nil, false)) } } @@ -746,7 +746,7 @@ func (server *BgpServer) propagateUpdate(peer *Peer, pathList []*table.Path) ([] if (peer == nil && targetPeer.isRouteServerClient()) || (peer != nil && peer.isRouteServerClient() != targetPeer.isRouteServerClient()) { continue } - if paths := targetPeer.processOutgoingPaths(best[targetPeer.TableID()]); len(paths) > 0 { + if paths := targetPeer.processOutgoingPaths(best[targetPeer.TableID()], withdrawn); len(paths) > 0 { msgs = append(msgs, newSenderMsg(targetPeer, paths, nil, false)) } } |