summaryrefslogtreecommitdiffhomepage
path: root/server
diff options
context:
space:
mode:
authorFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2014-12-30 23:31:52 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2014-12-30 23:31:52 +0900
commit7cac8709ad043b8aa2ce7dae378b7f921071835d (patch)
treea1cbb526802b62a457fc4a4f384121d72e225cce /server
parent40e40449ff08a0f226ca8b5cee04307a66a5e59f (diff)
table: make path.Clone private
table_manager.go clones withdraw path before passing it to peer.go clone() doesn't clone pathattributes. This patch adds a helper funciton to clone PathAttributes to message.go (it is used by createing BGPUpdate message to withdraw ipv6. later it will be used for 2 byte AS peer). Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Diffstat (limited to 'server')
-rw-r--r--server/peer.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/server/peer.go b/server/peer.go
index 702da772..b8dd2781 100644
--- a/server/peer.go
+++ b/server/peer.go
@@ -122,9 +122,12 @@ func (peer *Peer) handleREST(restReq *api.RestRequest) {
func (peer *Peer) handlePeermessage(m *message) {
sendpath := func(pList []table.Path, wList []table.Path) {
pathList := append([]table.Path(nil), pList...)
+ pathList = append(pathList, wList...)
for _, p := range wList {
- pathList = append(pathList, p.Clone(true))
+ if !p.IsWithdraw() {
+ log.Fatal("withdraw pathlist has non withdraw path")
+ }
}
peer.adjRib.UpdateOut(pathList)
peer.sendMessages(peer.path2update(pathList))