From 08c952ae078630f2e6b534e3f739c7a8cf1173e2 Mon Sep 17 00:00:00 2001 From: XANTRONIX Development Date: Sun, 19 Jul 2020 22:48:48 -0400 Subject: [PATCH] Fix issue setting parameter bit fields in sock.c Fix issue setting parameter bit fields in patty_ax25_sock_send_xid() in src/sock.c, wherein the numerical values were simply bitwise ORed --- src/sock.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/sock.c b/src/sock.c index 6750607..217e527 100644 --- a/src/sock.c +++ b/src/sock.c @@ -472,20 +472,19 @@ ssize_t patty_ax25_sock_send_disc(patty_ax25_sock *sock, int pf) { ssize_t patty_ax25_sock_send_xid(patty_ax25_sock *sock) { patty_ax25_params params; + ssize_t encoded; if (sock->remote.callsign[0] == '\0') { goto error_nopeer; } - params.flags = PATTY_AX25_PARAM_CLASSES - | PATTY_AX25_PARAM_HDLC - | PATTY_AX25_PARAM_INFO_TX - | PATTY_AX25_PARAM_INFO_RX - | PATTY_AX25_PARAM_WINDOW_TX - | PATTY_AX25_PARAM_WINDOW_RX - | PATTY_AX25_PARAM_ACK - | PATTY_AX25_PARAM_RETRY; + params.flags = (1 << PATTY_AX25_PARAM_CLASSES) + | (1 << PATTY_AX25_PARAM_HDLC) + | (1 << PATTY_AX25_PARAM_INFO_RX) + | (1 << PATTY_AX25_PARAM_WINDOW_RX) + | (1 << PATTY_AX25_PARAM_ACK) + | (1 << PATTY_AX25_PARAM_RETRY); /* * TODO: This value needs to come from the interface this socket is bound