From 4406b649af5368a34cd7dbec4605798deab5b575 Mon Sep 17 00:00:00 2001 From: Thomas Schoebel-Theuer Date: Tue, 16 Aug 2022 07:19:55 +0200 Subject: [PATCH] net: remember detected snd state transitions --- kernel/mars_net.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/kernel/mars_net.c b/kernel/mars_net.c index 336bfff6..74fef589 100644 --- a/kernel/mars_net.c +++ b/kernel/mars_net.c @@ -489,6 +489,10 @@ int _mars_send_raw(struct mars_socket *msock, const void *buf, int len) MARS_WRN("interrupting, sent = %d\n", sent); status = -EIDRM; break; + } else if (!msock->s_connected && + !_socket_not_connected(sock)) { + /* Remember the detected state transition ASAP */ + msock->s_connected = true; } #ifdef USE_SENDPAGE // FIXME: does not work, leads to data corruption (probably due to races with asynchrous sending)