diff --git a/src/server.c b/src/server.c index 738784d..10c7659 100644 --- a/src/server.c +++ b/src/server.c @@ -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 */ diff --git a/src/sock.c b/src/sock.c index 7052ea7..047e4d9 100644 --- a/src/sock.c +++ b/src/sock.c @@ -41,12 +41,10 @@ static size_t copy_addr_to_buf(patty_ax25_sock *sock, uint8_t *buf, size_t offse for (i=0; ihops; 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; - } } + 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,