diff options
Diffstat (limited to 'table/message.go')
-rw-r--r-- | table/message.go | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/table/message.go b/table/message.go index b3f730a3..4539834b 100644 --- a/table/message.go +++ b/table/message.go @@ -22,18 +22,21 @@ import ( ) func UpdatePathAttrs2ByteAs(msg *bgp.BGPUpdate) error { - // FIXME: clone var asAttr *bgp.PathAttributeAsPath - for _, attr := range msg.PathAttributes { + idx := 0 + for i, attr := range msg.PathAttributes { switch attr.(type) { case *bgp.PathAttributeAsPath: asAttr = attr.(*bgp.PathAttributeAsPath) + idx = i } } if asAttr == nil { return nil } + msg.PathAttributes = clonePathAttributes(msg.PathAttributes) + asAttr = msg.PathAttributes[idx].(*bgp.PathAttributeAsPath) as4pathParam := make([]*bgp.As4PathParam, 0) for i, param := range asAttr.Value { |