mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-02-28 08:40:49 +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. (cherry picked from commit9761e38f7e) (cherry picked from commit62ae5c0d0d)
This commit is contained in:
parent
d15e64360a
commit
87ee78e3cc
2 changed files with 2 additions and 2 deletions
|
|
@ -983,7 +983,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