diff --git a/route/bgp.go b/route/bgp.go index cde74bddecd79c022dc1f204ffb6a26b6879e2be..0942770d2fb2c9e8f4119739d346db799ac951f0 100644 --- a/route/bgp.go +++ b/route/bgp.go @@ -162,6 +162,15 @@ func (b *BGPPath) Prepend(asn uint32, times uint16) { b.ASPathLen = b.ASPathLen + uint16(times) } +func (p *BGPPath) Copy() *BGPPath { + if p == nil { + return nil + } + + cp := *p + return &cp +} + func uint32To4Byte(addr uint32) [4]byte { slice := convert.Uint32Byte(addr) ret := [4]byte{ @@ -172,12 +181,3 @@ func uint32To4Byte(addr uint32) [4]byte { } return ret } - -func (p *BGPPath) Copy() *BGPPath { - if p == nil { - return nil - } - - cp := *p - return &cp -}