From e077c21fc2e00da4633aa1af00c0197137e35e81 Mon Sep 17 00:00:00 2001 From: ISHIDA Wataru Date: Tue, 8 Sep 2015 23:07:42 +0900 Subject: table: fix bug of updating cluster-list path attribute we must clone whole path attribute when updating path attributes. Signed-off-by: ISHIDA Wataru --- table/path.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'table') 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...)) } } -- cgit v1.2.3