Skip to content

packet/bgp: Fix length calc when multiple RTM NLRIs#1754

Closed
iwaseyusuke wants to merge 1 commit into
osrg:masterfrom
iwaseyusuke:packet-bgp-Fix_length_calc_when_multiple_RTM_NLRIs
Closed

packet/bgp: Fix length calc when multiple RTM NLRIs#1754
iwaseyusuke wants to merge 1 commit into
osrg:masterfrom
iwaseyusuke:packet-bgp-Fix_length_calc_when_multiple_RTM_NLRIs

Conversation

@iwaseyusuke
Copy link
Copy Markdown
Contributor

When multiple RTM NLRIs are composed in a single MP_REACH_NLRI, the current implementation will fail to decode those NLRIs because RouteTargetMembershipNLRI.DecodeFromBytes() tests the length of the given bytes even if including the subsequent bytes.

This patch fixes to cut the bytes by using the prefix length before testing the byte length.

When multiple RTM NLRIs are composed in a single MP_REACH_NLRI, the
current implementation will fail to decode those NLRIs because
RouteTargetMembershipNLRI.DecodeFromBytes() tests the length of the
given bytes even if including the subsequent bytes.

This patch fixes to cut the bytes by using the prefix length before
testing the byte length.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
@fujita
Copy link
Copy Markdown
Member

fujita commented Jun 21, 2018

pushed, thanks.

@fujita fujita closed this Jun 21, 2018
@iwaseyusuke iwaseyusuke deleted the packet-bgp-Fix_length_calc_when_multiple_RTM_NLRIs branch June 21, 2018 13:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants