From 578cd23d591282b7a0f78201c28ff945e883e181 Mon Sep 17 00:00:00 2001 From: Cedric Roux Date: Sat, 18 Nov 2023 21:44:21 +0100 Subject: [PATCH] rfsimulator: ignore PIPE signal When au UE disconnects, a write on the rf simulator socket may generate a PIPE signal in the gnb and crash it. Let's ignore this signal. --- radio/rfsimulator/simulator.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/radio/rfsimulator/simulator.c b/radio/rfsimulator/simulator.c index e1bd7e1738..1111e48e6b 100644 --- a/radio/rfsimulator/simulator.c +++ b/radio/rfsimulator/simulator.c @@ -1119,5 +1119,11 @@ int device_init(openair0_device *device, openair0_config_t *openair0_cfg) { } } + /* write on a socket fails if the other end is closed and we get SIGPIPE */ + if (signal(SIGPIPE, SIG_IGN) == SIG_ERR) { + perror("SIGPIPE"); + exit(1); + } + return 0; }