wakaama icon indicating copy to clipboard operation
wakaama copied to clipboard

Add function to reset lwm2m-context of a client

Open pehrnord opened this issue 2 years ago • 3 comments

Signed-off-by: Pehr Nord [email protected]

#663

pehrnord avatar May 23 '22 13:05 pehrnord

Does lwm2m_context.nextMID need to be reset as well?

pehrnord avatar May 23 '22 13:05 pehrnord

Does lwm2m_context.nextMID need to be reset as well?

Maybe, you check RFC7252, Section 4 about the usage of the MID. Then you may describe the issue you consider in your case and how a reset or not reset will solve that.

In my experience, don't reset it. I only know one issue with MIDs after client restart: you may hit an coap-exchange, which is still kept for deduplication. But the probability of that doesn't change, if you reset the MID in advance. You may just check, if the response (if piggybacked) matches by the MID but not by the token. If that happens after a device restart, you may consider to reset the device MID by a new random value. Or wait for 247s (EXCHANGE_LIFETIME) in order to ensure, that the server's deduplication store is cleaned up.

boaks avatar May 30 '22 04:05 boaks

@pehrnord With the answer given by @boaks, Do you plan on updating this PR?

rettichschnidi avatar Mar 01 '23 08:03 rettichschnidi