diff --git a/src/server.c b/src/server.c index 1f7b492..98097b5 100644 --- a/src/server.c +++ b/src/server.c @@ -1040,19 +1040,6 @@ static int reply_ua(patty_ax25_if *iface, return reply_to(iface, frame, &reply); } -static int reply_frmr(patty_ax25_if *iface, - patty_ax25_frame *frame, - int flag) { - patty_ax25_frame reply = { - .control = PATTY_AX25_FRAME_FRMR | (flag << 4), - .proto = PATTY_AX25_PROTO_NONE, - .info = NULL, - .infolen = 0 - }; - - return reply_to(iface, frame, &reply); -} - static int handle_sabm(patty_ax25_server *server, patty_ax25_if *iface, patty_ax25_frame *frame) { @@ -1141,7 +1128,7 @@ static int handle_ua(patty_ax25_server *server, if ((sock = sock_by_addrpair(server->socks_pending_connect, &frame->dest, &frame->src)) == NULL) { - return reply_frmr(iface, frame, PATTY_AX25_FRAME_FINAL); + return reply_dm(iface, frame, PATTY_AX25_FRAME_FINAL); } if ((client = client_by_sock(server, sock)) < 0) { @@ -1269,13 +1256,14 @@ static int handle_disc(patty_ax25_server *server, if ((sock = sock_by_addrpair(server->socks_established, &frame->dest, &frame->src)) == NULL) { - return reply_frmr(iface, frame, PATTY_AX25_FRAME_FINAL); + goto done; } if (sock_close(server, sock) < 0) { goto error_sock_delete; } +done: if (frame->pf) { return reply_dm(iface, frame, PATTY_AX25_FRAME_FINAL); } @@ -1329,7 +1317,7 @@ static int handle_frame(patty_ax25_server *server, break; } - return reply_frmr(iface, &frame, PATTY_AX25_FRAME_FINAL); + return 0; error_io: return -1;