From 2ab713f3caefed2411adb9239b406424ccec05b9 Mon Sep 17 00:00:00 2001 From: Diego Ismirlian Date: Tue, 27 Oct 2020 13:12:03 +0000 Subject: [PATCH] Update interface index with received packet's index when getting session --- man/coap-client.txt.in | 5 ++++- src/coap_session.c | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/man/coap-client.txt.in b/man/coap-client.txt.in index 8d5e45d9..03194186 100644 --- a/man/coap-client.txt.in +++ b/man/coap-client.txt.in @@ -41,7 +41,10 @@ IPv6 address references, angle brackets are required (c.f. EXAMPLES). OPTIONS - General ----------------- *-a* addr:: - The local address of the interface that has to be used. + The local address of the interface that has to be used. + + Note: Do not use this option if the interface is likely to be transient - + i.e. it is a tunnel interface that may come and go, as this is likely to + cause "No such device" errors on transmission. *-b* [num,]size:: The block size to be used in GET/PUT/POST requests (value must be a diff --git a/src/coap_session.c b/src/coap_session.c index b94ddf53..f802fafc 100644 --- a/src/coap_session.c +++ b/src/coap_session.c @@ -507,6 +507,7 @@ coap_endpoint_get_session(coap_endpoint_t *endpoint, SESSIONS_FIND(endpoint->sessions, packet->addr_info, session); if (session) { + session->ifindex = packet->ifindex; session->last_rx_tx = now; return session; }