summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>2015-07-02 17:28:15 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2015-07-03 06:29:07 +0900
commitb7b1e18eec86ade7694a3e2ffa2d1c4e00b80006 (patch)
tree38e741497e3e5500977c5e4a35b5469be8aa33ab
parent6d9f671f493e03ddad3f8abd03351f35dc0381ab (diff)
server: update path attrs when sending update msg out
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
-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