Prevent I frame TX overflow

As per the AX.25 v2.2 Specification, Section 6.4.1, "Sending I Frames",
do not send an I frame if V(R) + x (TX window) equals V(S)
This commit is contained in:
XANTRONIX Development 2020-07-26 01:48:08 -04:00 committed by XANTRONIX Industrial
parent 7fd8be445a
commit 1ba57a8df2

View file

@ -1618,6 +1618,13 @@ static int handle_sock(uint32_t key,
goto done;
}
/*
* NOTE: See AX.25 2.2, Section 6.4.1, "Sending I Frames"
*/
if (sock->seq_recv + sock->n_window_tx == sock->seq_send) {
goto done;
}
if ((len = read(sock->fd, sock->rx_buf, sock->n_maxlen_rx)) < 0) {
if (errno == EIO) {
(void)sock_shutdown(server, sock);