diff options
Diffstat (limited to 'packet')
-rw-r--r-- | packet/bgp.go | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/packet/bgp.go b/packet/bgp.go index 3c477ae4..a38f4bca 100644 --- a/packet/bgp.go +++ b/packet/bgp.go @@ -3638,9 +3638,12 @@ func (p *PathAttributeMpReachNLRI) Serialize() ([]byte, error) { nexthoplen = 16 } offset := 0 - if safi == SAFI_MPLS_VPN { + switch safi { + case SAFI_MPLS_VPN: offset = 8 nexthoplen += 8 + case SAFI_FLOW_SPEC_VPN, SAFI_FLOW_SPEC_UNICAST: + nexthoplen = 0 } buf := make([]byte, 4+nexthoplen) binary.BigEndian.PutUint16(buf[0:], afi) |