summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--server/server.go4
-rw-r--r--table/message.go5
-rw-r--r--table/path.go2
3 files changed, 3 insertions, 8 deletions
diff --git a/server/server.go b/server/server.go
index b6fcc363..683fcc6d 100644
--- a/server/server.go
+++ b/server/server.go
@@ -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)
}
}
diff --git a/table/message.go b/table/message.go
index 7ae01152..d8bb3cff 100644
--- a/table/message.go
+++ b/table/message.go
@@ -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()
diff --git a/table/path.go b/table/path.go
index 1fd15308..51be91af 100644
--- a/table/path.go
+++ b/table/path.go
@@ -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