mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-25 14:10:08 +01:00
dhcp: fix handling of NM_DHCP_STATE_NOOP
The "noop" state is almost unused, however, nm_dhcp_set_state() has a check "if (new_state >= NM_DHCP_STATE_TIMEOUT)", so the order of the NOOP state matters. Fix that by reordering. Also, just return right away from NOOP.
This commit is contained in:
parent
f102051a29
commit
9761e38f7e
2 changed files with 2 additions and 2 deletions
|
|
@ -971,7 +971,7 @@ nm_dhcp_client_handle_event(gpointer unused,
|
|||
else if (NM_IN_STRSET_ASCII_CASE(reason, "fail", "abend"))
|
||||
new_state = NM_DHCP_STATE_FAIL;
|
||||
else if (NM_IN_STRSET_ASCII_CASE(reason, "preinit"))
|
||||
new_state = NM_DHCP_STATE_NOOP;
|
||||
return TRUE;
|
||||
else
|
||||
new_state = NM_DHCP_STATE_UNKNOWN;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -28,6 +28,7 @@
|
|||
|
||||
typedef enum {
|
||||
NM_DHCP_STATE_UNKNOWN = 0,
|
||||
NM_DHCP_STATE_NOOP, /* state is a non operation for NetworkManager */
|
||||
NM_DHCP_STATE_BOUND, /* new lease */
|
||||
NM_DHCP_STATE_EXTENDED, /* lease extended */
|
||||
NM_DHCP_STATE_TIMEOUT, /* timed out contacting server */
|
||||
|
|
@ -35,7 +36,6 @@ typedef enum {
|
|||
NM_DHCP_STATE_EXPIRE, /* lease expired or NAKed */
|
||||
NM_DHCP_STATE_FAIL, /* failed for some reason */
|
||||
NM_DHCP_STATE_TERMINATED, /* client is no longer running */
|
||||
NM_DHCP_STATE_NOOP, /* state is a non operation for NetworkManager */
|
||||
} NMDhcpState;
|
||||
|
||||
typedef enum _nm_packed {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue