Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix calculation of endaddress in cppmod ordt_addr_elem_array #45

Merged
merged 1 commit into from
Apr 9, 2018

Conversation

ebertland
Copy link
Contributor

When constructed, the startaddress and endaddress of an ordt_addr_elem_array
instance are the start and end addresses of a single element. In the
initializer of the ordt_addr_elem base class, the endaddress of the whole
array was calculated by adding the stride times the number of reps to the
endaddress passed in. This caused the endaddress of the array to be 1 element
beyond the end of the array, since the first element was already accounted
for. The fix is to add the stride times the reps minus 1.

When constructed, the startaddress and endaddress of an ordt_addr_elem_array
instance are the start and end addresses of a single element. In the
initializer of the ordt_addr_elem base class, the endaddress of the whole
array was calculated by adding the stride times the number of reps to the
endaddress passed in. This caused the endaddress of the array to be 1 element
beyond the end of the array, since the first element was already accounted
for. The fix is to add the stride times the reps minus 1.
@sdnellen sdnellen merged commit 451f38a into Juniper:master Apr 9, 2018
@ebertland ebertland deleted the jeff/ordt_addr_elem_array branch May 24, 2018 01:27
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