mirror of
https://github.com/osrg/gobgp.git
synced 2024-05-11 05:55:10 +00:00
server: update path attrs when sending update msg out
Signed-off-by: ISHIDA Wataru <[email protected]>
This commit is contained in:
committed by
FUJITA Tomonori
parent
6d9f671f49
commit
b7b1e18eec
+2
-2
@@ -513,7 +513,7 @@ func (server *BgpServer) propagateUpdate(neighborAddress string, RouteServerClie
|
||||
}
|
||||
f := filterpath(targetPeer, sendPathList)
|
||||
for _, path := range f {
|
||||
path.SetNexthop(targetPeer.config.LocalAddress)
|
||||
path.UpdatePathAttrs(&server.bgpConfig.Global, &targetPeer.config)
|
||||
}
|
||||
targetPeer.adjRib.UpdateOut(f)
|
||||
msgList := table.CreateUpdateMsgFromPaths(f)
|
||||
@@ -563,7 +563,7 @@ func (server *BgpServer) handleFSMMessage(peer *Peer, e *fsmMsg, incoming chan *
|
||||
peer.config.LocalAddress = peer.fsm.LocalAddr()
|
||||
for _, path := range peer.getBests(globalRib) {
|
||||
p := path.Clone(path.IsWithdraw)
|
||||
p.SetNexthop(peer.config.LocalAddress)
|
||||
p.UpdatePathAttrs(&server.bgpConfig.Global, &peer.config)
|
||||
pathList = append(pathList, p)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,7 +17,6 @@ package table
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"github.com/osrg/gobgp/config"
|
||||
"github.com/osrg/gobgp/packet"
|
||||
)
|
||||
|
||||
@@ -128,10 +127,6 @@ func cloneAttrSlice(attrs []bgp.PathAttributeInterface) []bgp.PathAttributeInter
|
||||
return clonedAttrs
|
||||
}
|
||||
|
||||
func UpdatePathAttrs(path *Path, global *config.Global, peer *config.Neighbor) {
|
||||
path.updatePathAttrs(global, peer)
|
||||
}
|
||||
|
||||
func createUpdateMsgFromPath(path *Path, msg *bgp.BGPMessage) *bgp.BGPMessage {
|
||||
rf := path.GetRouteFamily()
|
||||
|
||||
|
||||
+1
-1
@@ -68,7 +68,7 @@ func cloneAsPath(asAttr *bgp.PathAttributeAsPath) *bgp.PathAttributeAsPath {
|
||||
return bgp.NewPathAttributeAsPath(newASparams)
|
||||
}
|
||||
|
||||
func (path *Path) updatePathAttrs(global *config.Global, peer *config.Neighbor) {
|
||||
func (path *Path) UpdatePathAttrs(global *config.Global, peer *config.Neighbor) {
|
||||
|
||||
if peer.RouteServer.RouteServerClient {
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user