platform: add log detail for ENODEV at do_delete_object()

Deactivation of a NIC invokes deletion of qdisc. An ENODEV error can
be generated on deactivation of a virtual NIC when the kernel driver
has already deleted the device along with the qdisc.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1165
This commit is contained in:
Daisuke Matsuda 2022-03-28 11:34:22 +09:00 committed by Thomas Haller
parent 979dbd6d0d
commit fc2fab99b2
No known key found for this signature in database
GPG key ID: 29C2366E4DFC5728

View file

@ -7405,6 +7405,8 @@ do_delete_object(NMPlatform *platform, const NMPObject *obj_id, struct nl_msg *n
&& NM_IN_SET(NMP_OBJECT_GET_TYPE(obj_id), NMP_OBJECT_TYPE_IP6_ADDRESS)) {
/* On RHEL7 kernel, deleting a non existing address fails with ENXIO */
log_detail = ", meaning the address was already removed";
} else if (NM_IN_SET(-((int) seq_result), ENODEV)) {
log_detail = ", meaning the device was already removed";
} else if (NM_IN_SET(-((int) seq_result), EADDRNOTAVAIL)
&& NM_IN_SET(NMP_OBJECT_GET_TYPE(obj_id),
NMP_OBJECT_TYPE_IP4_ADDRESS,