Skip to content
Snippets Groups Projects
Unverified Commit 3d25ad5d authored by Daniel Czerwonk's avatar Daniel Czerwonk Committed by GitHub
Browse files

Merge pull request #77 from BarbarossaTM/unfuck/ASPath

BGPPath.insertNewASSequence() should extend the path in place.
parents 85a4309f 57d9032b
No related branches found
No related tags found
No related merge requests found
......@@ -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 {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment