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:Benjamin Lindqvist <benjamin.lindqvist@endian.se>
Loading
Please sign in to comment