From 1456d9aa0de1da9d9606a14c2df73d98393dc8cf Mon Sep 17 00:00:00 2001 From: chengshq Date: Tue, 7 Nov 2023 14:17:09 +0800 Subject: [PATCH] Fix inconsistent tokens received by other servers When use `coap-client` with -T command, the other server received inconsistent. ``` coap-client send token "aaa", the other server received "aab" coap-client send token "obstoken", the other server received "obstokeo" ``` --- src/coap_session.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/coap_session.c b/src/coap_session.c index 5cc3073d..682729ca 100644 --- a/src/coap_session.c +++ b/src/coap_session.c @@ -1583,7 +1583,7 @@ void coap_session_new_token(coap_session_t *session, size_t *len, uint8_t *data) { *len = coap_encode_var_safe8(data, - sizeof(session->tx_token), ++session->tx_token); + sizeof(session->tx_token), session->tx_token++); } uint16_t