From 513f56e215743f514c1e7ceccf5ddb9a2d702fed Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Tue, 19 Mar 2024 15:26:49 +0100 Subject: [PATCH] One RFsimulator end, close open connections Use the correct function in order to close open RFsim connections, instead of a simple close(). If this is not done correctly, it might happen that the softmodem closes, but an L1 thread might still read samples (bug in higher layers). Then, RFsim tries to read a socket (because it has an open connection), but the actual connection had been close()d. This commit fixes this behavior. --- radio/rfsimulator/simulator.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/radio/rfsimulator/simulator.c b/radio/rfsimulator/simulator.c index 0bfc26b10b..62d08da212 100644 --- a/radio/rfsimulator/simulator.c +++ b/radio/rfsimulator/simulator.c @@ -1038,7 +1038,7 @@ static void rfsimulator_end(openair0_device *device) { for (int i = 0; i < MAX_FD_RFSIMU; i++) { buffer_t *b = &s->buf[i]; if (b->conn_sock >= 0 ) - close(b->conn_sock); + removeCirBuf(s, b->conn_sock); } close(s->epollfd); }