Skip to content

Commit

Permalink
Handle ENOMEM under heaven-tx.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
jorisvink committed Nov 10, 2024
1 parent 157a964 commit 57bb1a6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/heaven_tx.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 57bb1a6

Please sign in to comment.