server: update path attrs when sending update msg out

Signed-off-by: ISHIDA Wataru <[email protected]>
This commit is contained in:
ISHIDA Wataru
2015-07-03 06:29:07 +09:00
committed by FUJITA Tomonori
parent 6d9f671f49
commit b7b1e18eec
3 changed files with 3 additions and 8 deletions
+2 -2
View File
@@ -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)
}
}
-5
View File
@@ -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
View File
@@ -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