diff options
author | ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp> | 2015-08-13 14:48:17 +0900 |
---|---|---|
committer | ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp> | 2015-08-13 15:08:26 +0900 |
commit | 97aefa5089c71f15ef942538b200d03df035b8aa (patch) | |
tree | fd5487e9c051757faf5807c2e42aa3e6ee98ba3d /packet | |
parent | 16bd6a794245dd45cf9688a05bb6c868623cb05d (diff) |
packet/cli: don't put nexthop in flowspec mp_reach_nlri path attribute
Reported-by: KATO Junya <kato.junya@lab.ntt.co.jp>
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
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) |