From 40507802ddac36012a59beec96cb02060f8d0293 Mon Sep 17 00:00:00 2001 From: Guus Sliepen Date: Sat, 4 Jul 2020 12:26:00 +0200 Subject: [PATCH] Ensure the maxtimeout value is taken from the destination node's device class. --- src/net_socket.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/net_socket.c b/src/net_socket.c index 6af4f738..a6923139 100644 --- a/src/net_socket.c +++ b/src/net_socket.c @@ -93,8 +93,10 @@ void retry_outgoing(meshlink_handle_t *mesh, outgoing_t *outgoing) { outgoing->timeout += 5; } - if(outgoing->timeout > mesh->dev_class_traits[mesh->devclass].maxtimeout) { - outgoing->timeout = mesh->dev_class_traits[mesh->devclass].maxtimeout; + int maxtimeout = mesh->dev_class_traits[outgoing->node->devclass].maxtimeout; + + if(outgoing->timeout > maxtimeout) { + outgoing->timeout = maxtimeout; } timeout_add(&mesh->loop, &outgoing->ev, retry_outgoing_handler, outgoing, &(struct timespec) { -- 2.39.5