diff options
author | Thomas Osterried <ax25@x-berg.in-berlin.de> | 2022-05-02 01:19:33 +0200 |
---|---|---|
committer | Thomas Osterried <ax25@x-berg.in-berlin.de> | 2022-05-02 01:19:33 +0200 |
commit | c6ced17d7804700138867b481e1e840086219a08 (patch) | |
tree | 3fa7ea0641b38f56510bf49e4a981fdfc237513e /call/call.c | |
parent | a9acec8157257f9a91db35260f6b53eb72c92f35 (diff) |
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 <ax25@x-berg.in-berlin.de>
Diffstat (limited to 'call/call.c')
-rw-r--r-- | call/call.c | 20 |
1 files changed, 10 insertions, 10 deletions
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; } |