From 3e99af64d19e164ea8149574e503685472d25b50 Mon Sep 17 00:00:00 2001 From: XANTRONIX Development Date: Wed, 8 Jul 2020 15:34:24 -0400 Subject: [PATCH] Use tcdrain() to flush frames to raw socks --- src/if.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/if.c b/src/if.c index cd6d817..c747c85 100644 --- a/src/if.c +++ b/src/if.c @@ -2,6 +2,7 @@ #include #include #include +#include #include #include @@ -323,7 +324,14 @@ static int handle_promisc_frame(void *key, int fd = (int)(value - NULL); struct promisc_frame *frame = ctx; - return write(fd, frame->buf, frame->len); + if (write(fd, frame->buf, frame->len) < 0) { + goto error_write; + } + + return tcdrain(fd); + +error_write: + return -1; } ssize_t patty_ax25_if_recv(patty_ax25_if *iface,