Handle incrementing seq_send elsewhere
This commit is contained in:
parent
0bfd5795ad
commit
a7cab09e47
1 changed files with 3 additions and 5 deletions
|
@ -211,15 +211,11 @@ ssize_t patty_ax25_sock_send(patty_ax25_sock *sock,
|
|||
if (sock->mode == PATTY_AX25_SOCK_SABME) {
|
||||
buf[offset++] = (control & 0xff00) >> 8;
|
||||
buf[offset++] = control & 0x00ff;
|
||||
|
||||
sock->seq_send = (sock->seq_send + 1) & 0x07;
|
||||
} else {
|
||||
buf[offset++] = control;
|
||||
|
||||
sock->seq_send = (sock->seq_send + 1) & 0x7f;
|
||||
}
|
||||
|
||||
if (PATTY_AX25_CONTROL_INFO(control)) {
|
||||
if (info) {
|
||||
buf[offset++] = (uint8_t)sock->proto;
|
||||
|
||||
memcpy(buf + offset, info, infolen);
|
||||
|
@ -275,6 +271,8 @@ ssize_t patty_ax25_sock_write(patty_ax25_sock *sock,
|
|||
goto error_send;
|
||||
}
|
||||
|
||||
patty_ax25_sock_seq_send_incr(sock);
|
||||
|
||||
return len;
|
||||
|
||||
error_send:
|
||||
|
|
Loading…
Add table
Reference in a new issue