From eb04bc4bb544a5864a26549e21f4064738927b57 Mon Sep 17 00:00:00 2001 From: XANTRONIX Development Date: Sun, 2 Aug 2020 19:14:57 -0400 Subject: [PATCH] Fix XID I field size TX, RX parameter encoding Fix XID I field size TX, RX parameter encoding to indicate the I frame size in bits, rather than octets --- src/print.c | 12 ++++++------ src/sock.c | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/print.c b/src/print.c index 3e4c2f4..182a1a0 100644 --- a/src/print.c +++ b/src/print.c @@ -167,12 +167,12 @@ int patty_print_params(FILE *fh, size_t value; char *name; } fields[] = { - { PATTY_AX25_PARAM_INFO_TX, params->info_tx, "I Field Length TX" }, - { PATTY_AX25_PARAM_INFO_RX, params->info_rx, "I Field Length RX" }, - { PATTY_AX25_PARAM_WINDOW_TX, params->window_tx, "Window Size TX" }, - { PATTY_AX25_PARAM_WINDOW_RX, params->window_rx, "Window Size RX" }, - { PATTY_AX25_PARAM_ACK, params->ack, "Ack timer" }, - { PATTY_AX25_PARAM_RETRY, params->retry, "Retry" }, + { PATTY_AX25_PARAM_INFO_TX, params->info_tx >> 3, "I Field Length TX" }, + { PATTY_AX25_PARAM_INFO_RX, params->info_rx >> 3, "I Field Length RX" }, + { PATTY_AX25_PARAM_WINDOW_TX, params->window_tx, "Window Size TX" }, + { PATTY_AX25_PARAM_WINDOW_RX, params->window_rx, "Window Size RX" }, + { PATTY_AX25_PARAM_ACK, params->ack, "Ack timer" }, + { PATTY_AX25_PARAM_RETRY, params->retry, "Retry" }, { 0, 0, NULL } }; diff --git a/src/sock.c b/src/sock.c index 6e343a8..eee1c80 100644 --- a/src/sock.c +++ b/src/sock.c @@ -252,7 +252,7 @@ int patty_ax25_sock_params_set(patty_ax25_sock *sock, if (params->flags & PATTY_AX25_PARAM_INFO_RX) { if (sock->n_maxlen_tx > params->info_rx) { - sock->n_maxlen_tx = params->info_rx; + sock->n_maxlen_tx = params->info_rx >> 3; } } @@ -560,7 +560,7 @@ ssize_t patty_ax25_sock_send_xid(patty_ax25_sock *sock, params.classes = sock->flags_classes; params.hdlc = sock->flags_hdlc; - params.info_rx = sock->n_maxlen_rx; + params.info_rx = sock->n_maxlen_rx << 3; params.window_rx = sock->n_window_rx; params.ack = sock->n_ack; params.retry = sock->n_retry;