From 57bb1a6d4c49d7e133d12656b6925eb3bbbc9439 Mon Sep 17 00:00:00 2001 From: Joris Vink Date: Sun, 10 Nov 2024 16:28:21 +0100 Subject: [PATCH] Handle ENOMEM under heaven-tx. Under certain conditions ENOMEM can be returned on certain OS's if it fails to grab an mbuf when doing a write on the tun device. It is a transient error and we should not fatal() on it. --- src/heaven_tx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/heaven_tx.c b/src/heaven_tx.c index acf3be0..6d9a23e 100644 --- a/src/heaven_tx.c +++ b/src/heaven_tx.c @@ -137,7 +137,7 @@ heaven_tx_send_packet(int fd, struct sanctum_packet *pkt) if (sanctum_platform_tundev_write(fd, pkt) == -1) { if (errno == EINTR) continue; - if (errno == EIO) + if (errno == EIO || errno == ENOMEM) break; if (errno == EAGAIN || errno == EWOULDBLOCK) break;