summaryrefslogtreecommitdiffhomepage
path: root/table
diff options
context:
space:
mode:
authorISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>2015-09-08 23:07:42 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2015-09-16 22:28:00 +0900
commite077c21fc2e00da4633aa1af00c0197137e35e81 (patch)
tree31aad36c7ef69debc09ad16c519aa500b657f1cf /table
parentfa613119057abbd7e6f6626a941efd81a47fe406 (diff)
table: fix bug of updating cluster-list path attribute
we must clone whole path attribute when updating path attributes. Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Diffstat (limited to 'table')
-rw-r--r--table/path.go7
1 files changed, 5 insertions, 2 deletions
diff --git a/table/path.go b/table/path.go
index 123b8a0c..0dcc1185 100644
--- a/table/path.go
+++ b/table/path.go
@@ -140,8 +140,11 @@ func (path *Path) UpdatePathAttrs(global *config.Global, peer *config.Neighbor)
path.pathAttrs = append(path.pathAttrs, p)
} else {
p := path.pathAttrs[idx].(*bgp.PathAttributeClusterList)
- p.Value = append([]net.IP{net.ParseIP(id).To4()}, p.Value...)
- path.pathAttrs[idx] = p
+ newClusterList := make([]string, 0, len(p.Value))
+ for _, ip := range p.Value {
+ newClusterList = append(newClusterList, ip.String())
+ }
+ path.pathAttrs[idx] = bgp.NewPathAttributeClusterList(append([]string{id}, newClusterList...))
}
}