AVSystem / Anjay

C implementation of the client-side OMA LwM2M protocol
Other
188 stars 68 forks source link

invalid critical option in query 0.03 Put: 3 #70

Open Spongman opened 10 months ago

Spongman commented 10 months ago

I'm seeing this error when my server sends a Uri-Host option in a PUT query to a connected Anjay client.

2023-10-25 17:37:56.465075 DEBUG [coap] [./Anjay/deps/avs_coap/src/avs_coap_ctx.c:464]: warning: invalid critical option in query 0.03 Put: 3

I see no justification for this error in rfc7252.

kFYatek commented 10 months ago

RFC 7252, section 5.4.1, says:

Unrecognized options of class "critical" that occur in a Confirmable request MUST cause the return of a 4.02 (Bad Option) response.

Uri-Host is a critical option, as you can see in Table 4 in the said RFC.

The only critical options recognized by Anjay are Uri-Path, Uri-Query, Accept, and, if block transfer support is enabled at compile time, Block1 and Block2. There is no code that would handle Uri-Host in any way, so the library must reject requests that contain it, as per the RFC.

May I ask what is the server that sends the Uri-Host option? Is there any specific reason for it to do so?