summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--server/peer.go13
-rw-r--r--server/server.go8
2 files changed, 14 insertions, 7 deletions
diff --git a/server/peer.go b/server/peer.go
index 55240cf6..c9c6e61e 100644
--- a/server/peer.go
+++ b/server/peer.go
@@ -123,8 +123,8 @@ func (peer *Peer) getAccepted(rfList []bgp.RouteFamily) []*table.Path {
return pathList
}
-func (peer *Peer) getBestFromLocal() ([]*table.Path, []*table.Path) {
- pathList, filtered := peer.ApplyPolicy(table.POLICY_DIRECTION_EXPORT, filterpath(peer, peer.localRib.GetBestPathList(peer.localRib.GetRFlist())))
+func (peer *Peer) getBestFromLocal(rfList []bgp.RouteFamily) ([]*table.Path, []*table.Path) {
+ pathList, filtered := peer.ApplyPolicy(table.POLICY_DIRECTION_EXPORT, filterpath(peer, peer.localRib.GetBestPathList(rfList)))
if peer.isRouteServerClient() == false {
for _, path := range pathList {
path.UpdatePathAttrs(&peer.gConf, &peer.conf)
@@ -203,7 +203,14 @@ func (peer *Peer) handleBGPmessage(m *bgp.BGPMessage) ([]*table.Path, bool, []*b
break
}
if _, ok := peer.capMap[bgp.BGP_CAP_ROUTE_REFRESH]; ok {
- pathList = peer.adjRib.GetOutPathList([]bgp.RouteFamily{rf})
+ rfList := []bgp.RouteFamily{rf}
+ peer.adjRib.DropOut(rfList)
+ pathList, filtered := peer.getBestFromLocal(rfList)
+ peer.adjRib.UpdateOut(pathList)
+ for _, path := range filtered {
+ path.IsWithdraw = true
+ pathList = append(pathList, path)
+ }
} else {
log.WithFields(log.Fields{
"Topic": "Peer",
diff --git a/server/server.go b/server/server.go
index 5f6ec58a..60aa4d3d 100644
--- a/server/server.go
+++ b/server/server.go
@@ -731,7 +731,7 @@ func (server *BgpServer) handleFSMMessage(peer *Peer, e *fsmMsg, incoming chan *
}
server.broadcastMsgs = append(server.broadcastMsgs, m)
}
- pathList, _ := peer.getBestFromLocal()
+ pathList, _ := peer.getBestFromLocal(peer.configuredRFlist())
if len(pathList) > 0 {
peer.adjRib.UpdateOut(pathList)
msgs = append(msgs, newSenderMsg(peer, table.CreateUpdateMsgFromPaths(pathList)))
@@ -1487,9 +1487,9 @@ func (server *BgpServer) handleGrpc(grpcReq *GrpcRequest) []*SenderMsg {
logOp(grpcReq.Name, "Neighbor soft reset out")
}
for _, peer := range peers {
- peer.adjRib.DropOut(peer.configuredRFlist())
-
- pathList, filtered := peer.getBestFromLocal()
+ rfList := peer.configuredRFlist()
+ peer.adjRib.DropOut(rfList)
+ pathList, filtered := peer.getBestFromLocal(rfList)
if len(pathList) > 0 {
peer.adjRib.UpdateOut(pathList)
msgs = append(msgs, newSenderMsg(peer, table.CreateUpdateMsgFromPaths(pathList)))