'''Implementations of this specification MUST set this field to 1 (01 binary). Other values are reserved for future versions. Messages with unknown version numbers MUST be silently ignored. '''
Actual Behavior
Instead of silently ignoring the CoAP message with an invalid version, the peer responds with a RST message.
Steps to reproduce
A CoAp message with the version 3 can be used to reproduce the non-conformance. You can find the wireshark interaction in the following.
invalid-version-handling.zip
Debug Logs
/libcoap/build/bin$ ./coap-server -v 8
May 08 17:34:31.800 DEBG created UDP endpoint [::]:5683
May 08 17:34:31.800 DEBG created TCP endpoint [::]:5683
May 08 17:34:34.241 DEBG ***[::ffff:127.0.0.1]:5683 <-> [::ffff:127.0.0.1]:4040 (if1) UDP : session 0x612b50: new incoming session
May 08 17:34:34.241 DEBG ***EVENT: 0x4001
May 08 17:34:34.241 DEBG * [::ffff:127.0.0.1]:5683 <-> [::ffff:127.0.0.1]:4040 (if1) UDP : received 32 bytes
May 08 17:34:34.241 DEBG coap_pdu_parse: UDP version not supported
May 08 17:34:34.241 WARN discard malformed PDU
May 08 17:34:34.241 DEBG * [::ffff:127.0.0.1]:5683 <-> [::ffff:127.0.0.1]:4040 (if1) UDP : sent 4 bytes
v:1 t:RST c:0.00 i:0000 {} [ ]
Environment
libcoap Configuration Summary
Problem Description
Upon receiving a CoAP message with an invalid version, the server responds with a RST message.
Expected Behavior
According to RFC7252:
Actual Behavior
Instead of silently ignoring the CoAP message with an invalid version, the peer responds with a RST message.
Steps to reproduce
A CoAp message with the version 3 can be used to reproduce the non-conformance. You can find the wireshark interaction in the following. invalid-version-handling.zip
Debug Logs