libnm/wired: fix mac comparison in _remove_mac_blacklist_item_by_value

The comparison checking for MAC address equality had previously been flipped around.

Fixes: b084ad7f2b ('libnm-core: canonicalize hardware addresses in settings')
This commit is contained in:
Jan Vaclav 2024-03-11 12:22:23 +01:00 committed by Fernando Fernandez Mancera
parent a810de57b6
commit a9c4c1d84e

View file

@ -415,7 +415,7 @@ nm_setting_wired_remove_mac_blacklist_item_by_value(NMSettingWired *setting, con
priv = NM_SETTING_WIRED_GET_PRIVATE(setting);
for (i = 0; i < priv->mac_address_blacklist->len; i++) {
candidate = nm_g_array_index(priv->mac_address_blacklist, char *, i);
if (!nm_utils_hwaddr_matches(mac, -1, candidate, -1)) {
if (nm_utils_hwaddr_matches(mac, -1, candidate, -1)) {
g_array_remove_index(priv->mac_address_blacklist, i);
_notify(setting, PROP_MAC_ADDRESS_BLACKLIST);
return TRUE;