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:
parent
7fd8be445a
commit
1ba57a8df2
1 changed files with 7 additions and 0 deletions
|
@ -1618,6 +1618,13 @@ static int handle_sock(uint32_t key,
|
||||||
goto done;
|
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 ((len = read(sock->fd, sock->rx_buf, sock->n_maxlen_rx)) < 0) {
|
||||||
if (errno == EIO) {
|
if (errno == EIO) {
|
||||||
(void)sock_shutdown(server, sock);
|
(void)sock_shutdown(server, sock);
|
||||||
|
|
Loading…
Add table
Reference in a new issue