summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-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...))
}
}