mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-06-18 16:38:30 +02:00
n-dhcp4: allow calling listen() on already listening connection
When the client enters the INIT state, it calls listen() on the
connection connection to create the packet socket. However, if the
client is coming from the REBOOTING state after a NAK, the connection
is already in the listening state; do nothing in such case.
(cherry picked from commit 4bcdc3c1eb)
This commit is contained in:
parent
568c19f07d
commit
2e1d3ae572
1 changed files with 3 additions and 0 deletions
|
|
@ -139,6 +139,9 @@ int n_dhcp4_c_connection_listen(NDhcp4CConnection *connection) {
|
|||
_c_cleanup_(c_closep) int fd_packet = -1;
|
||||
int r;
|
||||
|
||||
if (connection->state == N_DHCP4_C_CONNECTION_STATE_PACKET)
|
||||
return 0;
|
||||
|
||||
c_assert(connection->state == N_DHCP4_C_CONNECTION_STATE_INIT ||
|
||||
connection->state == N_DHCP4_C_CONNECTION_STATE_DRAINING ||
|
||||
connection->state == N_DHCP4_C_CONNECTION_STATE_UDP);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue