Send the right rejection packets

This commit is contained in:
XANTRONIX Development 2020-08-17 21:31:28 -05:00 committed by XANTRONIX Industrial
parent f26e977bfc
commit e34713c766

View file

@ -1484,7 +1484,7 @@ static int handle_segment(patty_ax25_server *server,
return 0; return 0;
reply_rej: reply_rej:
return patty_ax25_sock_send_rej(sock, PATTY_AX25_FRAME_RESPONSE, 0); return patty_ax25_sock_send_srej(sock, PATTY_AX25_FRAME_RESPONSE);
error_write: error_write:
error_sock_assembler_read: error_sock_assembler_read:
@ -1503,10 +1503,12 @@ static int handle_i(patty_ax25_server *server,
patty_ax25_sock_ack(sock, frame->nr - 1); patty_ax25_sock_ack(sock, frame->nr - 1);
if (sock->vr == frame->ns) { if (frame->ns == sock->vr) {
patty_ax25_sock_vr_incr(sock); patty_ax25_sock_vr_incr(sock);
} else { } else if (frame->ns == sock->vr + 1) {
return patty_ax25_sock_send_rej(sock, PATTY_AX25_FRAME_RESPONSE, 0); return patty_ax25_sock_send_srej(sock, PATTY_AX25_FRAME_RESPONSE);
} else if (frame->ns > sock->vr + 1) {
return patty_ax25_sock_send_rej(sock, PATTY_AX25_FRAME_RESPONSE, 1);
} }
if (frame->proto == PATTY_AX25_PROTO_FRAGMENT) { if (frame->proto == PATTY_AX25_PROTO_FRAGMENT) {