From 4bfe7da77bbe9275d4943aadd142282af9835f68 Mon Sep 17 00:00:00 2001 From: XANTRONIX Development Date: Sun, 19 Jul 2020 01:47:05 -0400 Subject: [PATCH] Handle XID frames in src/server.c Handle XID frames in src/server.c by decoding the parameter information and passing it to patty_ax25_sock_params_set() --- src/server.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/server.c b/src/server.c index a472de1..117f10b 100644 --- a/src/server.c +++ b/src/server.c @@ -1321,12 +1321,20 @@ static int handle_xid(patty_ax25_server *server, } /* - * TODO: Actually do something with the parameters received; also perhaps - * consider replying to this XID frame with another XID frame + * Since we've received an XID packet, we can assume that the remote + * station is capable of speaking AX.25 v2.2. Therefore, we should + * upgrade the socket defaults accordingly, and negotiate downwards + * as necessary. */ + patty_ax25_sock_upgrade(sock); + + if (patty_ax25_sock_params_set(sock, ¶ms) < 0) { + goto error_sock_params_set; + } return 0; +error_sock_params_set: error_io: return -1; }