Skip to content
Commit 81ccbd96 authored by Benjamin Lindqvist's avatar Benjamin Lindqvist Committed by Jukka Rissanen
Browse files

net: coap: Add internal init function to seed message_id

Randomly generating ID the first time coap_next_id() is called is more
in accordance with CoAP recommendations (see
https://tools.ietf.org/html/draft-ietf-core-coap-18

, section 4.4)

"It is strongly recommended that the initial value of the
variable (e.g., on startup) be randomized, in order to make successful
off-path attacks on the protocol less likely."

Doing this in a dedicated init function is the cleanest and most
idiomatic approach. This init function is not exposed publically which
means it will be called only once, by the network stack init procedure.

Signed-off-by: default avatarBenjamin Lindqvist <benjamin.lindqvist@endian.se>
parent 1ef9b20f
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment