diff --git a/src/server.c b/src/server.c index c188a52..92e19f3 100644 --- a/src/server.c +++ b/src/server.c @@ -633,10 +633,6 @@ static int server_setsockopt(patty_ax25_server *server, goto error_read; } - if (data.state == PATTY_AX25_SOCK_PROMISC) { - sock->state = PATTY_AX25_SOCK_PROMISC; - } - if ((iface = patty_ax25_server_get_if(server, data.name)) == NULL) { response.ret = -1; response.eno = ENODEV; @@ -644,6 +640,10 @@ static int server_setsockopt(patty_ax25_server *server, goto error_get_if; } + if (data.state == PATTY_AX25_SOCK_PROMISC) { + sock->state = PATTY_AX25_SOCK_PROMISC; + } + patty_ax25_sock_bind_if(sock, iface); fd_watch(server, sock->fd);