diff options
author | Eiichiro Watanabe <a16tochjp@gmail.com> | 2017-01-27 21:25:38 +0900 |
---|---|---|
committer | Eiichiro Watanabe <a16tochjp@gmail.com> | 2017-01-29 17:38:09 +0900 |
commit | 7336d9d54fb013c1760ce18b6c1594746ca4b469 (patch) | |
tree | 8f78ea1b23456dfa1075df393e3785ec7d7f0745 /packet/bgp | |
parent | 671b067a57a9199b0155ad1741b4ebab88a925f8 (diff) |
Fix End of RIB handling
- All of EoR except IPv4 unicast have MP_UNREACH only. (RFC4724)
- length of the MP_UNREACH attr. should be 3bytes.
- length of the value should be 0bytes.
- Should send EoR marker in initial exchange of BMP Route Monitoring. (RFC7854)
Diffstat (limited to 'packet/bgp')
-rw-r--r-- | packet/bgp/bgp.go | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/packet/bgp/bgp.go b/packet/bgp/bgp.go index 43ea66d6..9b7dfc97 100644 --- a/packet/bgp/bgp.go +++ b/packet/bgp/bgp.go @@ -7202,7 +7202,9 @@ func (msg *BGPUpdate) IsEndOfRib() (bool, RouteFamily) { return true, RF_IPv4_UC } else if len(msg.PathAttributes) == 1 && msg.PathAttributes[0].GetType() == BGP_ATTR_TYPE_MP_UNREACH_NLRI { unreach := msg.PathAttributes[0].(*PathAttributeMpUnreachNLRI) - return true, AfiSafiToRouteFamily(unreach.AFI, unreach.SAFI) + if len(unreach.Value) == 0 { + return true, AfiSafiToRouteFamily(unreach.AFI, unreach.SAFI) + } } } return false, RouteFamily(0) @@ -7225,7 +7227,7 @@ func NewEndOfRib(family RouteFamily) *BGPMessage { PathAttribute: PathAttribute{ Flags: PathAttrFlags[t], Type: t, - Length: 0, + Length: 3, }, AFI: afi, SAFI: safi, |