device: allow resetting the devip state via nm_device_devip_set_state()

There is no reason to disallow resetting the state.
This commit is contained in:
Thomas Haller 2022-09-28 18:34:50 +02:00
parent a5f125f8cb
commit 607a9544cb
No known key found for this signature in database
GPG key ID: 29C2366E4DFC5728
2 changed files with 6 additions and 2 deletions

View file

@ -89,7 +89,10 @@ nm_device_devip_set_state(NMDevice *self,
nm_assert(NM_IS_DEVICE(self));
nm_assert_addr_family_or_unspec(addr_family);
nm_assert(!l3cd || NM_IS_L3_CONFIG_DATA(l3cd));
nm_assert(NM_IN_SET(ip_state, NM_DEVICE_IP_STATE_PENDING, NM_DEVICE_IP_STATE_READY));
nm_assert(NM_IN_SET(ip_state,
NM_DEVICE_IP_STATE_NONE,
NM_DEVICE_IP_STATE_PENDING,
NM_DEVICE_IP_STATE_READY));
nm_device_devip_set_state_full(self, addr_family, ip_state, l3cd, NM_DEVICE_STATE_REASON_NONE);
}

View file

@ -9958,6 +9958,7 @@ nm_device_devip_set_state_full(NMDevice *self,
nm_assert_addr_family_or_unspec(addr_family);
nm_assert(NM_IN_SET(ip_state,
NM_DEVICE_IP_STATE_NONE,
NM_DEVICE_IP_STATE_PENDING,
NM_DEVICE_IP_STATE_READY,
NM_DEVICE_IP_STATE_FAILED));
@ -9965,7 +9966,7 @@ nm_device_devip_set_state_full(NMDevice *self,
nm_assert((ip_state != NM_DEVICE_IP_STATE_FAILED)
== (failed_reason == NM_DEVICE_STATE_REASON_NONE));
nm_assert((ip_state != NM_DEVICE_IP_STATE_FAILED) || !l3cd);
nm_assert(NM_IN_SET(ip_state, NM_DEVICE_IP_STATE_PENDING, NM_DEVICE_IP_STATE_READY) || !l3cd);
p = _dev_ipdev_data(self, addr_family);