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

Set Block2 M bit to zero in the request #105

Merged
merged 1 commit into from
Oct 27, 2024
Merged

Set Block2 M bit to zero in the request #105

merged 1 commit into from
Oct 27, 2024

Conversation

jloxfo2
Copy link
Contributor

@jloxfo2 jloxfo2 commented Oct 27, 2024

The current implementation copies the Block2 option from the response, increments the block number, and adds it to the next request in the block transfer. This is done when then M bit in the Block2 option from the response is set, which means that the bit is set when cloned and added back to the request. To be compliant with RFC-7959, set the M bit to zero before adding it back to the request.

Excerpt from RFC-7959:

"In a request, the client MUST set the M bit of a Block2 Option to zero and the server MUST ignore it on reception."

https://datatracker.ietf.org/doc/html/rfc7959#section-2.4

The current implementation copies the Block2 option from the response,
increments the block number, and adds it to the next request in the
block transfer. This is done when then M bit in the Block2 option from
the response is set, which means that the bit is set when cloned and
added back to the request. To be compliant with RFC-7959, set the M bit
to zero before adding it back to the request.

Excerpt from RFC-7959:

"In a request, the client MUST set the M bit of a Block2 Option to zero
and the server MUST ignore it on reception."

https://datatracker.ietf.org/doc/html/rfc7959#section-2.4
@Covertness
Copy link
Owner

Thanks. The check failed because of coap.me down.

@Covertness Covertness merged commit a5afd77 into Covertness:master Oct 27, 2024
0 of 2 checks passed
@jloxfo2 jloxfo2 deleted the client_block2_option branch October 27, 2024 20:10
@jloxfo2
Copy link
Contributor Author

jloxfo2 commented Oct 27, 2024

Thanks for the quick turnaround! Could we also update the version to 0.19.0 and publish the recent changes to crates.io?

@Covertness
Copy link
Owner

released: https://crates.io/crates/coap/0.19.0

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