Skip to content

sys/net/unicoap: properly handle options with value zero#22222

Merged
mguetschow merged 1 commit into
RIOT-OS:masterfrom
mguetschow:unicoap-option-value-zero
May 4, 2026
Merged

sys/net/unicoap: properly handle options with value zero#22222
mguetschow merged 1 commit into
RIOT-OS:masterfrom
mguetschow:unicoap-option-value-zero

Conversation

@mguetschow
Copy link
Copy Markdown
Contributor

Contribution description

CoAP options carrying the value 0 may have been encoded as with value-length zero (this is actually recommended by the RFC). unicoap would not have treated such encodings correctly while retrieving the option value.

While setting the option, unicoap already behaved as recommended.

Testing procedure

make -C tests/unittests tests-unicoap test

with an added test case should still pass with this PR (and wouldn't without).

Issues/PRs references

Encountered while working on experimental Uri-Path-Abbrev support based on #21582 in https://github.com/mguetschow/RIOT/tree/unicoap-uri-path-abbrev

Declaration of AI-Tools / LLMs usage:

AI-Tools / LLMs that were used are:

  • none

@mguetschow mguetschow requested review from carl-tud and removed request for Teufelchen1 and miri64 April 28, 2026 13:47
@github-actions github-actions Bot added Area: network Area: Networking Area: tests Area: tests and testing framework Area: CoAP Area: Constrained Application Protocol implementations Area: sys Area: System labels Apr 28, 2026
@mguetschow mguetschow added the CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR label Apr 28, 2026
@AnnsAnns
Copy link
Copy Markdown
Member

#22222 🥳 🎈 🎂

Comment thread tests/unittests/tests-unicoap/tests-unicoap-options.c Outdated
@crasbe crasbe added the Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors) label Apr 28, 2026
@riot-ci
Copy link
Copy Markdown

riot-ci commented Apr 28, 2026

Murdock results

✔️ PASSED

6128ad3 sys/net/unicoap: properly handle options with value zero

Success Failures Total Runtime
11108 0 11108 17m:38s

Artifacts

Comment thread tests/unittests/tests-unicoap/tests-unicoap-options.c Outdated
@carl-tud
Copy link
Copy Markdown
Contributor

carl-tud commented May 1, 2026

lgtm

@mguetschow mguetschow force-pushed the unicoap-option-value-zero branch from d4948fb to ba6784c Compare May 4, 2026 07:33
Comment thread tests/unittests/tests-unicoap/tests-unicoap-options.c Outdated
Comment thread tests/unittests/tests-unicoap/tests-unicoap-options.c
Comment thread tests/unittests/tests-unicoap/tests-unicoap-options.c Outdated
@mguetschow mguetschow enabled auto-merge May 4, 2026 10:24
@mguetschow mguetschow force-pushed the unicoap-option-value-zero branch from 7b579cc to 6128ad3 Compare May 4, 2026 10:25
@mguetschow mguetschow added this pull request to the merge queue May 4, 2026
Merged via the queue into RIOT-OS:master with commit 11f46f7 May 4, 2026
26 checks passed
@mguetschow
Copy link
Copy Markdown
Contributor Author

Thanks everyone! 🤗

@mguetschow mguetschow deleted the unicoap-option-value-zero branch May 4, 2026 16:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: CoAP Area: Constrained Application Protocol implementations Area: network Area: Networking Area: sys Area: System Area: tests Area: tests and testing framework CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants