Closed bathooman closed 4 months ago
It is worth checking the latest code version before reporting an issue. In this case, as of v4.3.2, options that are not repeatable should be tracked as expected. Please confirm this not an issue with the later code versions.
Environment
libcoap Configuration Summary
Problem Description
Upon receiving a CoAP message with an unrepeatable option, LibCoAP fails to behave correctly.
Expected Behavior
According to RFC7252:
Section 5.4.1 states:
Actual Behavior
In this case, we have a confirmable message containing three occurrences of an unrepeatable option (Uri-Port). While the correct behavior is to reject by sending a 4.02 (Bad Option) , LibCoAP proceeds with a piggybacked response.
Steps to reproduce
A confirmable CoAp message with two occurrences of Uri-Port option can be used to reproduce the non-conformance. You can find the wireshark interaction in the following.
invalid-unrepeatable-options-handling.zip
Debug Logs