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

Remove src_plen assignments which break v4mapped encoding #45

Closed
wants to merge 1 commit into from

Conversation

fblaese
Copy link
Contributor

@fblaese fblaese commented Sep 18, 2019

These assignments were introduced in f8bce04, probably
to ensure that src_plen doesn't contain any leftovers from
earlier revisions when source specific wasn't done via sub-TLVs.

This however breaks v4mapped encoding as a prefix length of 0
for IPv4 routes is represented as src_plen = 96. This offset is
already added outside of the affected functions and therefore
gets overwritten by this assignment.

Both functions contain an additional check if the message contains
ipv4 addresses, but as this check is only executed if the message has
a source-specific sub-TLV, the offset isn't added for non source-specific
routes.

Because the offset is already added outside of the subtlv parsing
functions, this additional check is also removed, as it would otherwise
break IPv4 source specifics by adding the IPv4 offset two times.

Signed-off-by: Fabian Bläse fabian@blaese.de

These assignments were introduced in f8bce04, probably
to ensure that src_plen doesn't contain any leftovers from
earlier revisions when source specific wasn't done via sub-TLVs.

This however breaks v4mapped encoding as a prefix length of 0
for IPv4 routes is represented as src_plen = 96. This offset is
already added outside of the affected functions and therefore
gets overwritten by this assignment.

Both functions contain an additional check if the message contains
ipv4 addresses, but as this check is only executed if the message has
a source-specific sub-TLV, the offset isn't added for non source-specific
routes.

Because the offset is already added outside of the subtlv parsing
functions, this additional check is also removed, as it would otherwise
break IPv4 source specifics by adding the IPv4 offset two times.

Signed-off-by: Fabian Bläse <fabian@blaese.de>
@jech
Copy link
Owner

jech commented Apr 17, 2020

There was a bug indeed, I've committed a different fix in 079bea9. Please let me know if there are any issues remaining.

@jech jech closed this Apr 17, 2020
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