From c6ced17d7804700138867b481e1e840086219a08 Mon Sep 17 00:00:00 2001 From: Thomas Osterried Date: Mon, 2 May 2022 01:19:33 +0200 Subject: In setsockopt section: if user requests EAX25 (option -me) and specifies a window size (> 7), call failed, because kernel checks if socket is in eax25 mode when setting window size > 7. -> setsockopt(...AX25_EXTSEQ...) has to be called before setsockopt(...AX25_WINDOW...) => Moved the etsockopt(...AX25_EXTSEQ...) in the code part in front of setsockopt(...AX25_WINDOW...) Signed-off-by: Thomas Osterried --- call/call.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'call') diff --git a/call/call.c b/call/call.c index 903b0e1..57e09cc 100644 --- a/call/call.c +++ b/call/call.c @@ -671,6 +671,16 @@ static int connect_to(char *address[]) ax25_aton_entry(mycall, sockaddr.ax25.fsa_ax25.sax25_call.ax25_call); addrlen = sizeof(struct full_sockaddr_ax25); + if (ax25mode != -1) { + if (setsockopt + (fd, SOL_AX25, AX25_EXTSEQ, &ax25mode, + sizeof(ax25mode)) == -1) { + perror("AX25_EXTSEQ"); + close(fd); + fd = -1; + return -1; + } + } if (setsockopt (fd, SOL_AX25, AX25_WINDOW, &window, sizeof(window)) == -1) { @@ -697,16 +707,6 @@ static int connect_to(char *address[]) return -1; } } - if (ax25mode != -1) { - if (setsockopt - (fd, SOL_AX25, AX25_EXTSEQ, &ax25mode, - sizeof(ax25mode)) == -1) { - perror("AX25_EXTSEQ"); - close(fd); - fd = -1; - return -1; - } - } break; } -- cgit v1.2.3