From 57d9032b95079c9b4b19af072fa4fdc20ef13d99 Mon Sep 17 00:00:00 2001 From: Maximilian Wilhelm <max@sdn.clinic> Date: Wed, 27 Jun 2018 00:13:04 +0200 Subject: [PATCH] BGPPath.insertNewASSequence() should extend the path in place. Signed-off-by: Maximilian Wilhelm <max@sdn.clinic> --- route/bgp_path.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/route/bgp_path.go b/route/bgp_path.go index baac670a..55db7045 100644 --- a/route/bgp_path.go +++ b/route/bgp_path.go @@ -225,16 +225,16 @@ func (b *BGPPath) Prepend(asn uint32, times uint16) { b.ASPathLen = b.ASPath.Length() } -func (b *BGPPath) insertNewASSequence() packet.ASPath { +func (b *BGPPath) insertNewASSequence() { pa := make(packet.ASPath, len(b.ASPath)+1) - copy(pa[1:], b.ASPath) + copy(b.ASPath, pa[1:]) pa[0] = packet.ASPathSegment{ ASNs: make([]uint32, 0), Count: 0, Type: packet.ASSequence, } - return pa + b.ASPath = pa } func (p *BGPPath) Copy() *BGPPath { -- GitLab