Fix address writing

This commit is contained in:
XANTRONIX Development 2020-06-26 23:03:00 -04:00 committed by XANTRONIX Industrial
parent cec916a44a
commit d983672619
2 changed files with 4 additions and 5 deletions

View file

@ -1041,6 +1041,7 @@ static int handle_packet_rx(patty_ax25_server *server,
if (PATTY_AX25_CONTROL_UNNUMBERED_SABM(frame.control)) {
fprintf(stderr, "Got SABM packet\n");
}
/*
* TODO: Handle inbound packet
*/

View file

@ -41,11 +41,9 @@ static size_t copy_addr_to_buf(patty_ax25_sock *sock, uint8_t *buf, size_t offse
for (i=0; i<sock->hops; i++) {
memcpy(&buf[offset], &sock->repeaters[i], sizeof(patty_ax25_addr));
offset += sizeof(patty_ax25_addr);
}
if (i == sock->hops - 1) {
buf[offset - 1] |= 0x01;
}
}
return offset;
}
@ -56,8 +54,8 @@ int patty_ax25_sock_send_sabm(patty_ax25_sock *sock) {
offset = copy_addr_to_buf(sock, buf, offset);
buf[offset++] = PATTY_AX25_PROTO_NONE;
buf[offset++] = 0x3f;
buf[offset++] = PATTY_AX25_PROTO_NONE;
return patty_ax25_if_send(sock->iface,
buf,