Don't change socket to SOCK_PROMISC for bad iface
In src/server.c, server_setsockopt(), do not change socket state to SOCK_PROMISC if the requested interface cannot be found
This commit is contained in:
parent
4c427854da
commit
acaa5dee0f
1 changed files with 4 additions and 4 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Reference in a new issue