Fix dropped packets to promisc interfaces

This commit is contained in:
XANTRONIX Development 2020-08-03 02:44:17 -04:00 committed by XANTRONIX Industrial
parent 16179894d2
commit c287eb7a61

View file

@ -292,6 +292,10 @@ static int sock_shutdown(patty_ax25_server *server,
patty_ax25_sock *sock) {
fd_clear(server, sock->fd);
if (sock->type != PATTY_AX25_SOCK_STREAM) {
return 0;
}
if (sock->status != PATTY_AX25_SOCK_ESTABLISHED) {
return 0;
}
@ -1754,11 +1758,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 (sock->type == PATTY_AX25_SOCK_STREAM) {
/*
* 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) {
@ -1779,10 +1785,12 @@ static int handle_sock(uint32_t key,
goto error_sock_write;
}
/*
* AX.25 v2.2, Section 6.4.1 "Sending I Frames"
*/
patty_timer_start(&sock->timer_t1, sock->n_ack);
if (sock->type == PATTY_AX25_SOCK_STREAM) {
/*
* AX.25 v2.2, Section 6.4.1 "Sending I Frames"
*/
patty_timer_start(&sock->timer_t1, sock->n_ack);
}
done:
return 0;