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

Block2 failure with size of 16 #130

Closed
kb2ma opened this issue Nov 17, 2018 · 2 comments
Closed

Block2 failure with size of 16 #130

kb2ma opened this issue Nov 17, 2018 · 2 comments

Comments

@kb2ma
Copy link
Contributor

kb2ma commented Nov 17, 2018

aiocoap encodes a Block2 option in a request improperly when block size is 16. The problem is that the length of the option should be 0 but is encoded as 1, as you can see in the last byte in the screenshot below of the request packet in Wireshark. Block size of 32 and 64 work fine.

You can use the linked example against the RIOT nanocoap_server example to recreate the problem. I tested against latest aiocoap master.

packet

@chrysn
Copy link
Owner

chrysn commented Nov 17, 2018

That's a very old issue actually, dating back to the very first commit. Fix is published o master.

Thanks for the report!

@chrysn chrysn closed this as completed in 9bd612d Nov 17, 2018
@kb2ma
Copy link
Contributor Author

kb2ma commented Nov 17, 2018

Works for me, thanks!

chrysn added a commit that referenced this issue Dec 5, 2018
Options used to have a length property.

Given that Python is far from embedded, and that every time an option's
length is queried, it's encoded right after, and the issue of [130],
that practice is abandoned and replaced with querying the encoded
option's length.

A test that covered the encoding lengths of integers was removed, as
that can't be meaningfully executed any more -- the length of the
options is already tested for where their values are compared to
hand-encoded reference values.

[130]: #130
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

No branches or pull requests

2 participants