From a810de57b61ea0ecba68468fc00973a1b8da0b18 Mon Sep 17 00:00:00 2001 From: Jan Vaclav Date: Mon, 18 Mar 2024 15:02:04 +0100 Subject: [PATCH 1/5] libnm-core: drop _NM_DEPRECATED_INCLUSIVE_LANGUAGE_1_48 macro --- src/libnm-core-public/nm-setting-wireless.h | 18 +++++++++--------- src/libnm-core-public/nm-version.h | 1 - 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/src/libnm-core-public/nm-setting-wireless.h b/src/libnm-core-public/nm-setting-wireless.h index 51060df114..e240a35495 100644 --- a/src/libnm-core-public/nm-setting-wireless.h +++ b/src/libnm-core-public/nm-setting-wireless.h @@ -169,20 +169,20 @@ const char *nm_setting_wireless_get_cloned_mac_address(NMSettingWireless *settin NM_AVAILABLE_IN_1_4 const char *nm_setting_wireless_get_generate_mac_address_mask(NMSettingWireless *setting); -_NM_DEPRECATED_INCLUSIVE_LANGUAGE_1_48 +NM_DEPRECATED_IN_1_48 const char *const *nm_setting_wireless_get_mac_address_blacklist(NMSettingWireless *setting); -_NM_DEPRECATED_INCLUSIVE_LANGUAGE_1_48 +NM_DEPRECATED_IN_1_48 guint32 nm_setting_wireless_get_num_mac_blacklist_items(NMSettingWireless *setting); -_NM_DEPRECATED_INCLUSIVE_LANGUAGE_1_48 +NM_DEPRECATED_IN_1_48 const char *nm_setting_wireless_get_mac_blacklist_item(NMSettingWireless *setting, guint32 idx); -_NM_DEPRECATED_INCLUSIVE_LANGUAGE_1_48 +NM_DEPRECATED_IN_1_48 gboolean nm_setting_wireless_add_mac_blacklist_item(NMSettingWireless *setting, const char *mac); -_NM_DEPRECATED_INCLUSIVE_LANGUAGE_1_48 +NM_DEPRECATED_IN_1_48 void nm_setting_wireless_remove_mac_blacklist_item(NMSettingWireless *setting, guint32 idx); -_NM_DEPRECATED_INCLUSIVE_LANGUAGE_1_48 -gboolean nm_setting_wireless_remove_mac_blacklist_item_by_value( - NMSettingWireless *setting, - _NM_DEPRECATED_INCLUSIVE_LANGUAGE_1_48 const char *mac); +NM_DEPRECATED_IN_1_48 +gboolean nm_setting_wireless_remove_mac_blacklist_item_by_value(NMSettingWireless *setting, + const char *mac); +NM_DEPRECATED_IN_1_48 void nm_setting_wireless_clear_mac_blacklist_items(NMSettingWireless *setting); const char *const *nm_setting_wireless_get_mac_address_denylist(NMSettingWireless *setting); diff --git a/src/libnm-core-public/nm-version.h b/src/libnm-core-public/nm-version.h index 2680a439b4..419da2e1f7 100644 --- a/src/libnm-core-public/nm-version.h +++ b/src/libnm-core-public/nm-version.h @@ -424,6 +424,5 @@ #define _NM_DEPRECATED_SYNC_METHOD NM_DEPRECATED_IN_1_24 #define _NM_DEPRECATED_SYNC_WRITABLE_PROPERTY /* NM_DEPRECATED_IN_1_22 */ #define _NM_DEPRECATED_INCLUSIVE_LANGUAGE_1_44 /* NM_DEPRECATED_IN_1_44 */ -#define _NM_DEPRECATED_INCLUSIVE_LANGUAGE_1_48 /* NM_DEPRECATED_IN_1_48 */ #endif /* NM_VERSION_H */ From a9c4c1d84ea31fc48293ca0ca62cbe2e8fd997e2 Mon Sep 17 00:00:00 2001 From: Jan Vaclav Date: Mon, 11 Mar 2024 12:22:23 +0100 Subject: [PATCH 2/5] 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: b084ad7f2b0d ('libnm-core: canonicalize hardware addresses in settings') --- src/libnm-core-impl/nm-setting-wired.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libnm-core-impl/nm-setting-wired.c b/src/libnm-core-impl/nm-setting-wired.c index e09fd70d94..70e2352eef 100644 --- a/src/libnm-core-impl/nm-setting-wired.c +++ b/src/libnm-core-impl/nm-setting-wired.c @@ -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; From da8b304c38049915466c1f5f0bbc8e8118c16d3b Mon Sep 17 00:00:00 2001 From: Jan Vaclav Date: Mon, 11 Mar 2024 12:55:44 +0100 Subject: [PATCH 3/5] libnm/wired: replace mac_address_blacklist type GArray with NMValueStrv This replaces the underlying type of mac_address_blacklist, which is currently GArray, with a more re-usable NMValueStrv, which allows us to implement it as a direct property. --- src/libnm-core-impl/nm-setting-wired.c | 178 +++++++++++-------------- 1 file changed, 79 insertions(+), 99 deletions(-) diff --git a/src/libnm-core-impl/nm-setting-wired.c b/src/libnm-core-impl/nm-setting-wired.c index 70e2352eef..f434460dad 100644 --- a/src/libnm-core-impl/nm-setting-wired.c +++ b/src/libnm-core-impl/nm-setting-wired.c @@ -53,20 +53,20 @@ typedef struct { guint len; guint n_alloc; } s390_options; - GArray *mac_address_blacklist; - char **s390_subchannels; - char *port; - char *duplex; - char *device_mac_address; - char *cloned_mac_address; - char *generate_mac_address_mask; - char *s390_nettype; - char *wol_password; - int accept_all_mac_addresses; - guint32 wake_on_lan; - guint32 speed; - guint32 mtu; - bool auto_negotiate; + char **s390_subchannels; + char *port; + char *duplex; + char *device_mac_address; + char *cloned_mac_address; + char *generate_mac_address_mask; + char *s390_nettype; + char *wol_password; + NMValueStrv mac_address_blacklist; + int accept_all_mac_addresses; + guint32 wake_on_lan; + guint32 speed; + guint32 mtu; + bool auto_negotiate; } NMSettingWiredPrivate; /** @@ -285,12 +285,11 @@ nm_setting_wired_get_generate_mac_address_mask(NMSettingWired *setting) const char *const * nm_setting_wired_get_mac_address_blacklist(NMSettingWired *setting) { - NMSettingWiredPrivate *priv; - g_return_val_if_fail(NM_IS_SETTING_WIRED(setting), NULL); - priv = NM_SETTING_WIRED_GET_PRIVATE(setting); - return nm_g_array_data(priv->mac_address_blacklist); + return nm_strvarray_get_strv_notnull( + NM_SETTING_WIRED_GET_PRIVATE(setting)->mac_address_blacklist.arr, + NULL); } /** @@ -304,7 +303,7 @@ nm_setting_wired_get_num_mac_blacklist_items(NMSettingWired *setting) { g_return_val_if_fail(NM_IS_SETTING_WIRED(setting), 0); - return NM_SETTING_WIRED_GET_PRIVATE(setting)->mac_address_blacklist->len; + return nm_g_array_len(NM_SETTING_WIRED_GET_PRIVATE(setting)->mac_address_blacklist.arr); } /** @@ -320,19 +319,11 @@ nm_setting_wired_get_num_mac_blacklist_items(NMSettingWired *setting) const char * nm_setting_wired_get_mac_blacklist_item(NMSettingWired *setting, guint32 idx) { - NMSettingWiredPrivate *priv; - g_return_val_if_fail(NM_IS_SETTING_WIRED(setting), NULL); - priv = NM_SETTING_WIRED_GET_PRIVATE(setting); - - if (idx == priv->mac_address_blacklist->len) { - return NULL; - } - - g_return_val_if_fail(idx < priv->mac_address_blacklist->len, NULL); - - return nm_g_array_index(priv->mac_address_blacklist, const char *, idx); + return nm_strvarray_get_idxnull_or_greturn( + NM_SETTING_WIRED_GET_PRIVATE(setting)->mac_address_blacklist.arr, + idx); } /** @@ -349,24 +340,27 @@ gboolean nm_setting_wired_add_mac_blacklist_item(NMSettingWired *setting, const char *mac) { NMSettingWiredPrivate *priv; + guint8 mac_bin[ETH_ALEN]; const char *candidate; - int i; + guint i; + guint len; g_return_val_if_fail(NM_IS_SETTING_WIRED(setting), FALSE); g_return_val_if_fail(mac != NULL, FALSE); - if (!nm_utils_hwaddr_valid(mac, ETH_ALEN)) + if (!_nm_utils_hwaddr_aton_exact(mac, mac_bin, ETH_ALEN)) return FALSE; 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)) + len = nm_g_array_len(priv->mac_address_blacklist.arr); + for (i = 0; i < len; i++) { + candidate = nm_g_array_index(priv->mac_address_blacklist.arr, char *, i); + if (nm_utils_hwaddr_matches(mac_bin, ETH_ALEN, candidate, -1)) return FALSE; } - mac = nm_utils_hwaddr_canonical(mac, ETH_ALEN); - g_array_append_val(priv->mac_address_blacklist, mac); + nm_g_array_append_simple(nm_strvarray_ensure(&priv->mac_address_blacklist.arr), + nm_utils_hwaddr_ntoa(mac_bin, ETH_ALEN)); _notify(setting, PROP_MAC_ADDRESS_BLACKLIST); return TRUE; } @@ -386,9 +380,13 @@ nm_setting_wired_remove_mac_blacklist_item(NMSettingWired *setting, guint32 idx) g_return_if_fail(NM_IS_SETTING_WIRED(setting)); priv = NM_SETTING_WIRED_GET_PRIVATE(setting); - g_return_if_fail(idx < priv->mac_address_blacklist->len); + if (!priv->mac_address_blacklist.arr) { + return; + } - g_array_remove_index(priv->mac_address_blacklist, idx); + g_return_if_fail(idx < priv->mac_address_blacklist.arr->len); + + g_array_remove_index(priv->mac_address_blacklist.arr, idx); _notify(setting, PROP_MAC_ADDRESS_BLACKLIST); } @@ -406,21 +404,28 @@ gboolean nm_setting_wired_remove_mac_blacklist_item_by_value(NMSettingWired *setting, const char *mac) { NMSettingWiredPrivate *priv; + guint8 mac_bin[ETH_ALEN]; const char *candidate; - int i; + guint i; g_return_val_if_fail(NM_IS_SETTING_WIRED(setting), FALSE); g_return_val_if_fail(mac != NULL, FALSE); + if (!_nm_utils_hwaddr_aton_exact(mac, mac_bin, ETH_ALEN)) + return FALSE; + 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)) { - g_array_remove_index(priv->mac_address_blacklist, i); - _notify(setting, PROP_MAC_ADDRESS_BLACKLIST); - return TRUE; + if (priv->mac_address_blacklist.arr) { + for (i = 0; i < priv->mac_address_blacklist.arr->len; i++) { + candidate = nm_g_array_index(priv->mac_address_blacklist.arr, char *, i); + if (nm_utils_hwaddr_matches(mac_bin, ETH_ALEN, candidate, -1)) { + g_array_remove_index(priv->mac_address_blacklist.arr, i); + _notify(setting, PROP_MAC_ADDRESS_BLACKLIST); + return TRUE; + } } } + return FALSE; } @@ -435,8 +440,8 @@ nm_setting_wired_clear_mac_blacklist_items(NMSettingWired *setting) { g_return_if_fail(NM_IS_SETTING_WIRED(setting)); - g_array_set_size(NM_SETTING_WIRED_GET_PRIVATE(setting)->mac_address_blacklist, 0); - _notify(setting, PROP_MAC_ADDRESS_BLACKLIST); + if (nm_strvarray_clear(&NM_SETTING_WIRED_GET_PRIVATE(setting)->mac_address_blacklist.arr)) + _notify(setting, PROP_MAC_ADDRESS_BLACKLIST); } /** @@ -815,20 +820,22 @@ verify(NMSetting *setting, NMConnection *connection, GError **error) return FALSE; } - for (i = 0; i < priv->mac_address_blacklist->len; i++) { - const char *mac = nm_g_array_index(priv->mac_address_blacklist, const char *, i); + if (priv->mac_address_blacklist.arr) { + for (i = 0; i < priv->mac_address_blacklist.arr->len; i++) { + const char *mac = nm_g_array_index(priv->mac_address_blacklist.arr, const char *, i); - if (!nm_utils_hwaddr_valid(mac, ETH_ALEN)) { - g_set_error(error, - NM_CONNECTION_ERROR, - NM_CONNECTION_ERROR_INVALID_PROPERTY, - _("'%s' is not a valid MAC address"), - mac); - g_prefix_error(error, - "%s.%s: ", - NM_SETTING_WIRED_SETTING_NAME, - NM_SETTING_WIRED_MAC_ADDRESS_BLACKLIST); - return FALSE; + if (!nm_utils_hwaddr_valid(mac, ETH_ALEN)) { + g_set_error(error, + NM_CONNECTION_ERROR, + NM_CONNECTION_ERROR_INVALID_PROPERTY, + _("'%s' is not a valid MAC address"), + mac); + g_prefix_error(error, + "%s.%s: ", + NM_SETTING_WIRED_SETTING_NAME, + NM_SETTING_WIRED_MAC_ADDRESS_BLACKLIST); + return FALSE; + } } } @@ -992,14 +999,6 @@ compare_fcn_cloned_mac_address(_NM_SETT_INFO_PROP_COMPARE_FCN_ARGS _nm_nil) /*****************************************************************************/ -static void -clear_blacklist_item(char **item_p) -{ - g_free(*item_p); -} - -/*****************************************************************************/ - static void get_property(GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) { @@ -1012,9 +1011,6 @@ get_property(GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) case PROP_CLONED_MAC_ADDRESS: g_value_set_string(value, nm_setting_wired_get_cloned_mac_address(setting)); break; - case PROP_MAC_ADDRESS_BLACKLIST: - g_value_set_boxed(value, nm_g_array_data(priv->mac_address_blacklist)); - break; case PROP_S390_SUBCHANNELS: g_value_set_boxed(value, priv->s390_subchannels); break; @@ -1037,8 +1033,6 @@ static void set_property(GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) { NMSettingWiredPrivate *priv = NM_SETTING_WIRED_GET_PRIVATE(object); - const char *const *blacklist; - const char *mac; switch (prop_id) { case PROP_CLONED_MAC_ADDRESS: @@ -1046,18 +1040,6 @@ set_property(GObject *object, guint prop_id, const GValue *value, GParamSpec *ps priv->cloned_mac_address = _nm_utils_hwaddr_canonical_or_invalid(g_value_get_string(value), ETH_ALEN); break; - case PROP_MAC_ADDRESS_BLACKLIST: - blacklist = g_value_get_boxed(value); - g_array_set_size(priv->mac_address_blacklist, 0); - if (blacklist && *blacklist) { - guint i; - - for (i = 0; blacklist[i]; i++) { - mac = _nm_utils_hwaddr_canonical_or_invalid(blacklist[i], ETH_ALEN); - g_array_append_val(priv->mac_address_blacklist, mac); - } - } - break; case PROP_S390_SUBCHANNELS: if (priv->s390_subchannels) g_strfreev(priv->s390_subchannels); @@ -1135,13 +1117,7 @@ set_property(GObject *object, guint prop_id, const GValue *value, GParamSpec *ps static void nm_setting_wired_init(NMSettingWired *setting) -{ - NMSettingWiredPrivate *priv = NM_SETTING_WIRED_GET_PRIVATE(setting); - - /* We use GArray rather than GPtrArray so it will automatically be NULL-terminated */ - priv->mac_address_blacklist = g_array_new(TRUE, FALSE, sizeof(char *)); - g_array_set_clear_func(priv->mac_address_blacklist, (GDestroyNotify) clear_blacklist_item); -} +{} /** * nm_setting_wired_new: @@ -1164,7 +1140,6 @@ finalize(GObject *object) _s390_options_clear(priv); g_free(priv->cloned_mac_address); - g_array_unref(priv->mac_address_blacklist); g_strfreev(priv->s390_subchannels); G_OBJECT_CLASS(nm_setting_wired_parent_class)->finalize(object); @@ -1486,11 +1461,16 @@ nm_setting_wired_class_init(NMSettingWiredClass *klass) * example: HWADDR_BLACKLIST="00:22:68:11:69:08 00:11:22:11:44:55" * ---end--- */ - _nm_setting_property_define_gprop_strv_oldstyle(properties_override, - obj_properties, - NM_SETTING_WIRED_MAC_ADDRESS_BLACKLIST, - PROP_MAC_ADDRESS_BLACKLIST, - NM_SETTING_PARAM_FUZZY_IGNORE); + _nm_setting_property_define_direct_strv(properties_override, + obj_properties, + NM_SETTING_WIRED_MAC_ADDRESS_BLACKLIST, + PROP_MAC_ADDRESS_BLACKLIST, + NM_SETTING_PARAM_FUZZY_IGNORE, + NULL, + NMSettingWiredPrivate, + mac_address_blacklist, + .direct_set_strv_normalize_hwaddr = TRUE, + .direct_strv_not_null = TRUE); /** * NMSettingWired:mtu: From f2d91b4a6824eaeed9373f1701248b9e990f448e Mon Sep 17 00:00:00 2001 From: Jan Vaclav Date: Wed, 13 Mar 2024 12:44:59 +0100 Subject: [PATCH 4/5] wired: deprecate NMSettingWired mac-address-blacklist property To embrace inclusive language, deprecate the NMSettingWired mac-address-blacklist property and introduce mac-address-denylist property. --- NEWS | 2 + src/libnm-client-impl/libnm.ver | 7 + ...gen-metadata-nm-settings-libnm-core.xml.in | 5 + src/libnm-core-impl/nm-setting-private.h | 6 + src/libnm-core-impl/nm-setting-wired.c | 345 +++++++++++++++--- src/libnm-core-impl/nm-setting.c | 3 +- src/libnm-core-impl/tests/test-general.c | 1 + src/libnm-core-impl/tests/test-setting.c | 3 +- src/libnm-core-public/nm-setting-wired.h | 25 +- src/libnmc-setting/nm-meta-setting-desc.c | 15 + src/libnmc-setting/settings-docs.h.in | 1 + .../gen-metadata-nm-settings-nmcli.xml.in | 3 + .../test_003.expected | 320 ++++++++-------- tools/test-networkmanager-service.py | 3 + 14 files changed, 516 insertions(+), 223 deletions(-) diff --git a/NEWS b/NEWS index 9382f95c59..e2bdb9cb5c 100644 --- a/NEWS +++ b/NEWS @@ -13,6 +13,8 @@ USE AT YOUR OWN RISK. NOT RECOMMENDED FOR PRODUCTION USE! * The reason why a device is unmanaged is now properly set in the "StateReason" property of the "Device" D-Bus object. The property is visible in nmcli via "nmcli -f all device show $DEV". +* Deprecated 802-11-wireless and 802-11-wired property 'mac-address-blacklist' + and introduced the 'mac-address-denylist' property. ============================================= NetworkManager-1.46 diff --git a/src/libnm-client-impl/libnm.ver b/src/libnm-client-impl/libnm.ver index 6d7da16f81..f75c9ef728 100644 --- a/src/libnm-client-impl/libnm.ver +++ b/src/libnm-client-impl/libnm.ver @@ -1984,6 +1984,13 @@ global: nm_setting_connection_down_on_poweroff_get_type; nm_setting_connection_get_down_on_poweroff; nm_setting_ip_config_get_dhcp_send_release; + nm_setting_wired_add_mac_denylist_item; + nm_setting_wired_clear_mac_denylist_items; + nm_setting_wired_get_mac_address_denylist; + nm_setting_wired_get_mac_denylist_item; + nm_setting_wired_get_num_mac_denylist_items; + nm_setting_wired_remove_mac_denylist_item; + nm_setting_wired_remove_mac_denylist_item_by_value; nm_setting_wireless_add_mac_denylist_item; nm_setting_wireless_clear_mac_denylist_items; nm_setting_wireless_get_mac_address_denylist; diff --git a/src/libnm-core-impl/gen-metadata-nm-settings-libnm-core.xml.in b/src/libnm-core-impl/gen-metadata-nm-settings-libnm-core.xml.in index 04340e6dd6..5379a6f8bd 100644 --- a/src/libnm-core-impl/gen-metadata-nm-settings-libnm-core.xml.in +++ b/src/libnm-core-impl/gen-metadata-nm-settings-libnm-core.xml.in @@ -496,6 +496,11 @@ gprop-type="gchararray" /> + diff --git a/src/libnm-core-impl/nm-setting-private.h b/src/libnm-core-impl/nm-setting-private.h index f16bf8dea3..f784fc0eec 100644 --- a/src/libnm-core-impl/nm-setting-private.h +++ b/src/libnm-core-impl/nm-setting-private.h @@ -429,6 +429,12 @@ GVariant *_nm_setting_wireless_mac_denylist_to_dbus(_NM_SETT_INFO_PROP_TO_DBUS_F gboolean _nm_setting_wireless_mac_blacklist_from_dbus(_NM_SETT_INFO_PROP_FROM_DBUS_FCN_ARGS _nm_nil); +gboolean _nm_setting_wired_mac_denylist_from_dbus(_NM_SETT_INFO_PROP_FROM_DBUS_FCN_ARGS _nm_nil); + +GVariant *_nm_setting_wired_mac_denylist_to_dbus(_NM_SETT_INFO_PROP_TO_DBUS_FCN_ARGS _nm_nil); + +gboolean _nm_setting_wired_mac_blacklist_from_dbus(_NM_SETT_INFO_PROP_FROM_DBUS_FCN_ARGS _nm_nil); + GVariant *_nm_setting_to_dbus(NMSetting *setting, NMConnection *connection, NMConnectionSerializationFlags flags, diff --git a/src/libnm-core-impl/nm-setting-wired.c b/src/libnm-core-impl/nm-setting-wired.c index f434460dad..2c8562d3c4 100644 --- a/src/libnm-core-impl/nm-setting-wired.c +++ b/src/libnm-core-impl/nm-setting-wired.c @@ -39,6 +39,7 @@ NM_GOBJECT_PROPERTIES_DEFINE(NMSettingWired, PROP_CLONED_MAC_ADDRESS, PROP_GENERATE_MAC_ADDRESS_MASK, PROP_MAC_ADDRESS_BLACKLIST, + PROP_MAC_ADDRESS_DENYLIST, PROP_MTU, PROP_S390_SUBCHANNELS, PROP_S390_NETTYPE, @@ -61,7 +62,7 @@ typedef struct { char *generate_mac_address_mask; char *s390_nettype; char *wol_password; - NMValueStrv mac_address_blacklist; + NMValueStrv mac_address_denylist; int accept_all_mac_addresses; guint32 wake_on_lan; guint32 speed; @@ -277,67 +278,73 @@ nm_setting_wired_get_generate_mac_address_mask(NMSettingWired *setting) } /** - * nm_setting_wired_get_mac_address_blacklist: + * nm_setting_wired_get_mac_address_denylist: * @setting: the #NMSettingWired * - * Returns: the #NMSettingWired:mac-address-blacklist property of the setting + * Returns: the #NMSettingWired:mac-address-denylist property of the setting + * + * Since: 1.48 **/ const char *const * -nm_setting_wired_get_mac_address_blacklist(NMSettingWired *setting) +nm_setting_wired_get_mac_address_denylist(NMSettingWired *setting) { g_return_val_if_fail(NM_IS_SETTING_WIRED(setting), NULL); return nm_strvarray_get_strv_notnull( - NM_SETTING_WIRED_GET_PRIVATE(setting)->mac_address_blacklist.arr, + NM_SETTING_WIRED_GET_PRIVATE(setting)->mac_address_denylist.arr, NULL); } /** - * nm_setting_wired_get_num_mac_blacklist_items: + * nm_setting_wired_get_num_mac_denylist_items: * @setting: the #NMSettingWired * - * Returns: the number of blacklisted MAC addresses + * Returns: the number of denylisted MAC addresses + * + * Since: 1.48 **/ -guint32 -nm_setting_wired_get_num_mac_blacklist_items(NMSettingWired *setting) +guint +nm_setting_wired_get_num_mac_denylist_items(NMSettingWired *setting) { g_return_val_if_fail(NM_IS_SETTING_WIRED(setting), 0); - return nm_g_array_len(NM_SETTING_WIRED_GET_PRIVATE(setting)->mac_address_blacklist.arr); + return nm_g_array_len(NM_SETTING_WIRED_GET_PRIVATE(setting)->mac_address_denylist.arr); } /** - * nm_setting_wired_get_mac_blacklist_item: + * nm_setting_wired_get_mac_denylist_item: * @setting: the #NMSettingWired * @idx: the zero-based index of the MAC address entry * - * Since 1.46, access at index "len" is allowed and returns NULL. - * - * Returns: the blacklisted MAC address string (hex-digits-and-colons notation) + * Returns: the denylisted MAC address string (hex-digits-and-colons notation) * at index @idx + * + * Since: 1.48 **/ const char * -nm_setting_wired_get_mac_blacklist_item(NMSettingWired *setting, guint32 idx) +nm_setting_wired_get_mac_denylist_item(NMSettingWired *setting, guint idx) { g_return_val_if_fail(NM_IS_SETTING_WIRED(setting), NULL); return nm_strvarray_get_idxnull_or_greturn( - NM_SETTING_WIRED_GET_PRIVATE(setting)->mac_address_blacklist.arr, + NM_SETTING_WIRED_GET_PRIVATE(setting)->mac_address_denylist.arr, idx); } /** - * nm_setting_wired_add_mac_blacklist_item: + * nm_setting_wired_add_mac_denylist_item: * @setting: the #NMSettingWired - * @mac: the MAC address string (hex-digits-and-colons notation) to blacklist + * @mac: the MAC address string (hex-digits-and-colons notation) to denylist * - * Adds a new MAC address to the #NMSettingWired:mac-address-blacklist property. + * Adds a new MAC address to the #NMSettingWired:mac-address-denylist property. * * Returns: %TRUE if the MAC address was added; %FALSE if the MAC address * is invalid or was already present + * + * Since: 1.48 **/ gboolean -nm_setting_wired_add_mac_blacklist_item(NMSettingWired *setting, const char *mac) +nm_setting_wired_add_mac_denylist_item(NMSettingWired *setting, const char *mac) { NMSettingWiredPrivate *priv; guint8 mac_bin[ETH_ALEN]; @@ -352,56 +359,60 @@ nm_setting_wired_add_mac_blacklist_item(NMSettingWired *setting, const char *mac return FALSE; priv = NM_SETTING_WIRED_GET_PRIVATE(setting); - len = nm_g_array_len(priv->mac_address_blacklist.arr); + len = nm_g_array_len(priv->mac_address_denylist.arr); for (i = 0; i < len; i++) { - candidate = nm_g_array_index(priv->mac_address_blacklist.arr, char *, i); + candidate = nm_g_array_index(priv->mac_address_denylist.arr, char *, i); if (nm_utils_hwaddr_matches(mac_bin, ETH_ALEN, candidate, -1)) return FALSE; } - nm_g_array_append_simple(nm_strvarray_ensure(&priv->mac_address_blacklist.arr), + nm_g_array_append_simple(nm_strvarray_ensure(&priv->mac_address_denylist.arr), nm_utils_hwaddr_ntoa(mac_bin, ETH_ALEN)); - _notify(setting, PROP_MAC_ADDRESS_BLACKLIST); + _notify(setting, PROP_MAC_ADDRESS_DENYLIST); return TRUE; } /** - * nm_setting_wired_remove_mac_blacklist_item: + * nm_setting_wired_remove_mac_denylist_item: * @setting: the #NMSettingWired * @idx: index number of the MAC address * - * Removes the MAC address at index @idx from the blacklist. + * Removes the MAC address at index @idx from the denylist. + * + * Since: 1.48 **/ void -nm_setting_wired_remove_mac_blacklist_item(NMSettingWired *setting, guint32 idx) +nm_setting_wired_remove_mac_denylist_item(NMSettingWired *setting, guint idx) { NMSettingWiredPrivate *priv; g_return_if_fail(NM_IS_SETTING_WIRED(setting)); priv = NM_SETTING_WIRED_GET_PRIVATE(setting); - if (!priv->mac_address_blacklist.arr) { + if (!priv->mac_address_denylist.arr) { return; } - g_return_if_fail(idx < priv->mac_address_blacklist.arr->len); + g_return_if_fail(idx < priv->mac_address_denylist.arr->len); - g_array_remove_index(priv->mac_address_blacklist.arr, idx); - _notify(setting, PROP_MAC_ADDRESS_BLACKLIST); + g_array_remove_index(priv->mac_address_denylist.arr, idx); + _notify(setting, PROP_MAC_ADDRESS_DENYLIST); } /** - * nm_setting_wired_remove_mac_blacklist_item_by_value: + * nm_setting_wired_remove_mac_denylist_item_by_value: * @setting: the #NMSettingWired * @mac: the MAC address string (hex-digits-and-colons notation) to remove from - * the blacklist + * the denylist * - * Removes the MAC address @mac from the blacklist. + * Removes the MAC address @mac from the denylist. * * Returns: %TRUE if the MAC address was found and removed; %FALSE if it was not. + * + * Since: 1.48 **/ gboolean -nm_setting_wired_remove_mac_blacklist_item_by_value(NMSettingWired *setting, const char *mac) +nm_setting_wired_remove_mac_denylist_item_by_value(NMSettingWired *setting, const char *mac) { NMSettingWiredPrivate *priv; guint8 mac_bin[ETH_ALEN]; @@ -415,12 +426,12 @@ nm_setting_wired_remove_mac_blacklist_item_by_value(NMSettingWired *setting, con return FALSE; priv = NM_SETTING_WIRED_GET_PRIVATE(setting); - if (priv->mac_address_blacklist.arr) { - for (i = 0; i < priv->mac_address_blacklist.arr->len; i++) { - candidate = nm_g_array_index(priv->mac_address_blacklist.arr, char *, i); + if (priv->mac_address_denylist.arr) { + for (i = 0; i < priv->mac_address_denylist.arr->len; i++) { + candidate = nm_g_array_index(priv->mac_address_denylist.arr, char *, i); if (nm_utils_hwaddr_matches(mac_bin, ETH_ALEN, candidate, -1)) { - g_array_remove_index(priv->mac_address_blacklist.arr, i); - _notify(setting, PROP_MAC_ADDRESS_BLACKLIST); + g_array_remove_index(priv->mac_address_denylist.arr, i); + _notify(setting, PROP_MAC_ADDRESS_DENYLIST); return TRUE; } } @@ -429,19 +440,187 @@ nm_setting_wired_remove_mac_blacklist_item_by_value(NMSettingWired *setting, con return FALSE; } +/** + * nm_setting_wired_clear_mac_denylist_items: + * @setting: the #NMSettingWired + * + * Removes all denylisted MAC addresses. + * + * Since: 1.48 + **/ +void +nm_setting_wired_clear_mac_denylist_items(NMSettingWired *setting) +{ + g_return_if_fail(NM_IS_SETTING_WIRED(setting)); + + if (nm_strvarray_clear(&NM_SETTING_WIRED_GET_PRIVATE(setting)->mac_address_denylist.arr)) + _notify(setting, PROP_MAC_ADDRESS_DENYLIST); +} + +/** + * nm_setting_wired_get_mac_address_blacklist: + * @setting: the #NMSettingWired + * + * Returns: the #NMSettingWired:mac-address-blacklist property of the setting + * + * Deprecated: 1.48. Use nm_setting_wired_get_mac_address_denylist() instead. + **/ +const char *const * +nm_setting_wired_get_mac_address_blacklist(NMSettingWired *setting) +{ + return nm_setting_wired_get_mac_address_denylist(setting); +} + +/** + * nm_setting_wired_get_num_mac_blacklist_items: + * @setting: the #NMSettingWired + * + * Returns: the number of blacklisted MAC addresses + * + * Deprecated: 1.48. Use nm_setting_wired_get_num_mac_denylist_items() instead. + **/ +guint32 +nm_setting_wired_get_num_mac_blacklist_items(NMSettingWired *setting) +{ + return nm_setting_wired_get_num_mac_denylist_items(setting); +} + +/** + * nm_setting_wired_get_mac_blacklist_item: + * @setting: the #NMSettingWired + * @idx: the zero-based index of the MAC address entry + * + * Since 1.48, access at index "len" is allowed and returns NULL. + * + * Returns: the blacklisted MAC address string (hex-digits-and-colons notation) + * at index @idx + * + * Deprecated: 1.48. Use nm_setting_wired_get_mac_denylist_item() instead. + **/ +const char * +nm_setting_wired_get_mac_blacklist_item(NMSettingWired *setting, guint32 idx) +{ + return nm_setting_wired_get_mac_denylist_item(setting, idx); +} + +/** + * nm_setting_wired_add_mac_blacklist_item: + * @setting: the #NMSettingWired + * @mac: the MAC address string (hex-digits-and-colons notation) to blacklist + * + * Adds a new MAC address to the #NMSettingWired:mac-address-blacklist property. + * + * Returns: %TRUE if the MAC address was added; %FALSE if the MAC address + * is invalid or was already present + * + * Deprecated: 1.48. Use nm_setting_wired_add_mac_denylist_item() instead. + **/ +gboolean +nm_setting_wired_add_mac_blacklist_item(NMSettingWired *setting, const char *mac) +{ + return nm_setting_wired_add_mac_denylist_item(setting, mac); +} + +/** + * nm_setting_wired_remove_mac_blacklist_item: + * @setting: the #NMSettingWired + * @idx: index number of the MAC address + * + * Removes the MAC address at index @idx from the blacklist. + * + * Deprecated: 1.48. Use nm_setting_wired_remove_mac_denylist_item() instead. + **/ +void +nm_setting_wired_remove_mac_blacklist_item(NMSettingWired *setting, guint32 idx) +{ + return nm_setting_wired_remove_mac_denylist_item(setting, idx); +} + +/** + * nm_setting_wired_remove_mac_blacklist_item_by_value: + * @setting: the #NMSettingWired + * @mac: the MAC address string (hex-digits-and-colons notation) to remove from + * the blacklist + * + * Removes the MAC address @mac from the blacklist. + * + * Returns: %TRUE if the MAC address was found and removed; %FALSE if it was not. + * + * Deprecated: 1.48. Use nm_setting_wired_remove_mac_denylist_item_by_value() instead. + **/ +gboolean +nm_setting_wired_remove_mac_blacklist_item_by_value(NMSettingWired *setting, const char *mac) +{ + return nm_setting_wired_remove_mac_denylist_item_by_value(setting, mac); +} + /** * nm_setting_wired_clear_mac_blacklist_items: * @setting: the #NMSettingWired * * Removes all blacklisted MAC addresses. + * + * Deprecated: 1.48. Use nm_setting_wired_clear_mac_denylist_items() instead. **/ void nm_setting_wired_clear_mac_blacklist_items(NMSettingWired *setting) { - g_return_if_fail(NM_IS_SETTING_WIRED(setting)); + return nm_setting_wired_clear_mac_denylist_items(setting); +} - if (nm_strvarray_clear(&NM_SETTING_WIRED_GET_PRIVATE(setting)->mac_address_blacklist.arr)) - _notify(setting, PROP_MAC_ADDRESS_BLACKLIST); +gboolean +_nm_setting_wired_mac_blacklist_from_dbus(_NM_SETT_INFO_PROP_FROM_DBUS_FCN_ARGS _nm_nil) +{ + const gchar **mac_blacklist; + + if (!_nm_setting_use_legacy_property(setting, + connection_dict, + NM_SETTING_WIRED_MAC_ADDRESS_BLACKLIST, + NM_SETTING_WIRED_MAC_ADDRESS_DENYLIST)) { + *out_is_modified = FALSE; + return TRUE; + } + mac_blacklist = g_variant_get_strv(value, NULL); + + g_object_set(setting, NM_SETTING_WIRED_MAC_ADDRESS_BLACKLIST, mac_blacklist, NULL); + return TRUE; +} + +gboolean +_nm_setting_wired_mac_denylist_from_dbus(_NM_SETT_INFO_PROP_FROM_DBUS_FCN_ARGS _nm_nil) +{ + const gchar **mac_denylist; + + if (!_nm_setting_use_legacy_property(setting, + connection_dict, + NM_SETTING_WIRED_MAC_ADDRESS_BLACKLIST, + NM_SETTING_WIRED_MAC_ADDRESS_DENYLIST)) { + *out_is_modified = FALSE; + return TRUE; + } + mac_denylist = g_variant_get_strv(value, NULL); + + g_object_set(setting, NM_SETTING_WIRED_MAC_ADDRESS_DENYLIST, mac_denylist, NULL); + return TRUE; +} + +GVariant * +_nm_setting_wired_mac_denylist_to_dbus(_NM_SETT_INFO_PROP_TO_DBUS_FCN_ARGS _nm_nil) +{ + const char *const *mac_denylist; + /* FIXME: `mac-address-denylist` is an alias of `mac-address-blacklist` property. + * Serializing the property to the clients would break them as they won't + * be able to drop it if they are not aware of the existance of + * `mac-address-denylist`. In order to give them time to adapt their code, + * NetworkManager is not serializing `mac-address-denylist` on DBus. + */ + if (_nm_utils_is_manager_process) { + return NULL; + } + + mac_denylist = nm_setting_wired_get_mac_address_denylist(NM_SETTING_WIRED(setting)); + + return g_variant_new_strv(mac_denylist, -1); } /** @@ -820,9 +999,9 @@ verify(NMSetting *setting, NMConnection *connection, GError **error) return FALSE; } - if (priv->mac_address_blacklist.arr) { - for (i = 0; i < priv->mac_address_blacklist.arr->len; i++) { - const char *mac = nm_g_array_index(priv->mac_address_blacklist.arr, const char *, i); + if (priv->mac_address_denylist.arr) { + for (i = 0; i < priv->mac_address_denylist.arr->len; i++) { + const char *mac = nm_g_array_index(priv->mac_address_denylist.arr, const char *, i); if (!nm_utils_hwaddr_valid(mac, ETH_ALEN)) { g_set_error(error, @@ -833,7 +1012,7 @@ verify(NMSetting *setting, NMConnection *connection, GError **error) g_prefix_error(error, "%s.%s: ", NM_SETTING_WIRED_SETTING_NAME, - NM_SETTING_WIRED_MAC_ADDRESS_BLACKLIST); + NM_SETTING_WIRED_MAC_ADDRESS_DENYLIST); return FALSE; } } @@ -1151,6 +1330,7 @@ nm_setting_wired_class_init(NMSettingWiredClass *klass) GObjectClass *object_class = G_OBJECT_CLASS(klass); NMSettingClass *setting_class = NM_SETTING_CLASS(klass); GArray *properties_override = _nm_sett_info_property_override_create_array(); + guint prop_idx; object_class->get_property = get_property; object_class->set_property = set_property; @@ -1461,16 +1641,67 @@ nm_setting_wired_class_init(NMSettingWiredClass *klass) * example: HWADDR_BLACKLIST="00:22:68:11:69:08 00:11:22:11:44:55" * ---end--- */ - _nm_setting_property_define_direct_strv(properties_override, - obj_properties, - NM_SETTING_WIRED_MAC_ADDRESS_BLACKLIST, - PROP_MAC_ADDRESS_BLACKLIST, - NM_SETTING_PARAM_FUZZY_IGNORE, - NULL, - NMSettingWiredPrivate, - mac_address_blacklist, - .direct_set_strv_normalize_hwaddr = TRUE, - .direct_strv_not_null = TRUE); + prop_idx = _nm_setting_property_define_direct_strv( + properties_override, + obj_properties, + NM_SETTING_WIRED_MAC_ADDRESS_BLACKLIST, + PROP_MAC_ADDRESS_BLACKLIST, + NM_SETTING_PARAM_FUZZY_IGNORE, + NM_SETT_INFO_PROPERT_TYPE_DBUS(G_VARIANT_TYPE_STRING_ARRAY, + .direct_type = NM_VALUE_TYPE_STRV, + .compare_fcn = _nm_setting_property_compare_fcn_direct, + .to_dbus_fcn = _nm_setting_property_to_dbus_fcn_direct, + .from_dbus_fcn = + _nm_setting_wired_mac_blacklist_from_dbus, ), + NMSettingWiredPrivate, + mac_address_denylist, + .direct_set_strv_normalize_hwaddr = TRUE, + .direct_strv_not_null = TRUE, + .direct_is_aliased_field = TRUE, + .is_deprecated = TRUE); + + /** + * NMSettingWired:mac-address-denylist: + * + * If specified, this connection will never apply to the Ethernet device + * whose permanent MAC address matches an address in the list. Each MAC + * address is in the standard hex-digits-and-colons notation + * (00:11:22:33:44:55). + **/ + /* ---keyfile--- + * property: mac-address-denylist + * format: list of MACs (separated with semicolons) + * description: MAC address denylist. + * example: mac-address-denylist= 00:22:68:12:79:A6;00:22:68:12:79:78 + * ---end--- + */ + /* ---ifcfg-rh--- + * property: mac-address-denylist + * variable: HWADDR_BLACKLIST(+) + * description: It denies usage of the connection for any device whose address + * is listed. + * example: HWADDR_BLACKLIST="00:22:68:11:69:08 00:11:22:11:44:55" + * ---end--- + */ + _nm_setting_property_define_direct_strv( + properties_override, + obj_properties, + NM_SETTING_WIRED_MAC_ADDRESS_DENYLIST, + PROP_MAC_ADDRESS_DENYLIST, + NM_SETTING_PARAM_FUZZY_IGNORE, + NM_SETT_INFO_PROPERT_TYPE_DBUS(G_VARIANT_TYPE_STRING_ARRAY, + .direct_type = NM_VALUE_TYPE_STRV, + .compare_fcn = _nm_setting_property_compare_fcn_direct, + .to_dbus_fcn = _nm_setting_wired_mac_denylist_to_dbus, + .from_dbus_fcn = _nm_setting_wired_mac_denylist_from_dbus, ), + NMSettingWiredPrivate, + mac_address_denylist, + .direct_set_strv_normalize_hwaddr = TRUE, + .direct_strv_not_null = TRUE, + .direct_also_notify = obj_properties[PROP_MAC_ADDRESS_BLACKLIST], ); + + nm_g_array_index(properties_override, NMSettInfoProperty, prop_idx).direct_also_notify = + obj_properties[PROP_MAC_ADDRESS_DENYLIST]; /** * NMSettingWired:mtu: diff --git a/src/libnm-core-impl/nm-setting.c b/src/libnm-core-impl/nm-setting.c index 70f756b52b..bbaa6fcda2 100644 --- a/src/libnm-core-impl/nm-setting.c +++ b/src/libnm-core-impl/nm-setting.c @@ -2733,7 +2733,8 @@ _nm_setting_property_compare_fcn_direct(_NM_SETT_INFO_PROP_COMPARE_FCN_ARGS _nm_ _nm_setting_connection_controller_to_dbus, _nm_setting_connection_port_type_to_dbus, _nm_setting_connection_autoconnect_ports_to_dbus, - _nm_setting_wireless_mac_denylist_to_dbus)); + _nm_setting_wireless_mac_denylist_to_dbus, + _nm_setting_wired_mac_denylist_to_dbus)); if (!property_info->param_spec) return nm_assert_unreachable_val(NM_TERNARY_DEFAULT); diff --git a/src/libnm-core-impl/tests/test-general.c b/src/libnm-core-impl/tests/test-general.c index 43c88273c5..f745d0596d 100644 --- a/src/libnm-core-impl/tests/test-general.c +++ b/src/libnm-core-impl/tests/test-general.c @@ -4048,6 +4048,7 @@ test_connection_diff_a_only(void) {NM_SETTING_WIRED_CLONED_MAC_ADDRESS, NM_SETTING_DIFF_RESULT_IN_A}, {NM_SETTING_WIRED_GENERATE_MAC_ADDRESS_MASK, NM_SETTING_DIFF_RESULT_IN_A}, {NM_SETTING_WIRED_MAC_ADDRESS_BLACKLIST, NM_SETTING_DIFF_RESULT_IN_A}, + {NM_SETTING_WIRED_MAC_ADDRESS_DENYLIST, NM_SETTING_DIFF_RESULT_IN_A}, {NM_SETTING_WIRED_MTU, NM_SETTING_DIFF_RESULT_IN_A}, {NM_SETTING_WIRED_S390_SUBCHANNELS, NM_SETTING_DIFF_RESULT_IN_A}, {NM_SETTING_WIRED_S390_NETTYPE, NM_SETTING_DIFF_RESULT_IN_A}, diff --git a/src/libnm-core-impl/tests/test-setting.c b/src/libnm-core-impl/tests/test-setting.c index 142ac0e11d..f330916649 100644 --- a/src/libnm-core-impl/tests/test-setting.c +++ b/src/libnm-core-impl/tests/test-setting.c @@ -4734,7 +4734,8 @@ test_setting_metadata(void) g_assert(g_variant_type_equal(sip->property_type->dbus_type, "as")); g_assert(NM_IN_SET(sip->property_type->to_dbus_fcn, _nm_setting_property_to_dbus_fcn_direct, - _nm_setting_wireless_mac_denylist_to_dbus)); + _nm_setting_wireless_mac_denylist_to_dbus, + _nm_setting_wired_mac_denylist_to_dbus)); g_assert(sip->param_spec); g_assert(sip->param_spec->value_type == G_TYPE_STRV); } else diff --git a/src/libnm-core-public/nm-setting-wired.h b/src/libnm-core-public/nm-setting-wired.h index 5ad3b7f2c9..dab2297888 100644 --- a/src/libnm-core-public/nm-setting-wired.h +++ b/src/libnm-core-public/nm-setting-wired.h @@ -73,6 +73,7 @@ typedef enum /*< flags >*/ { #define NM_SETTING_WIRED_CLONED_MAC_ADDRESS "cloned-mac-address" #define NM_SETTING_WIRED_GENERATE_MAC_ADDRESS_MASK "generate-mac-address-mask" #define NM_SETTING_WIRED_MAC_ADDRESS_BLACKLIST "mac-address-blacklist" +#define NM_SETTING_WIRED_MAC_ADDRESS_DENYLIST "mac-address-denylist" #define NM_SETTING_WIRED_MTU "mtu" #define NM_SETTING_WIRED_S390_SUBCHANNELS "s390-subchannels" #define NM_SETTING_WIRED_S390_NETTYPE "s390-nettype" @@ -99,14 +100,30 @@ NMTernary nm_setting_wired_get_accept_all_mac_addresses(NMSettingWired *setting) NM_AVAILABLE_IN_1_4 const char *nm_setting_wired_get_generate_mac_address_mask(NMSettingWired *setting); +NM_DEPRECATED_IN_1_48 const char *const *nm_setting_wired_get_mac_address_blacklist(NMSettingWired *setting); -guint32 nm_setting_wired_get_num_mac_blacklist_items(NMSettingWired *setting); -const char *nm_setting_wired_get_mac_blacklist_item(NMSettingWired *setting, guint32 idx); +NM_DEPRECATED_IN_1_48 +guint32 nm_setting_wired_get_num_mac_blacklist_items(NMSettingWired *setting); +NM_DEPRECATED_IN_1_48 +const char *nm_setting_wired_get_mac_blacklist_item(NMSettingWired *setting, guint32 idx); +NM_DEPRECATED_IN_1_48 gboolean nm_setting_wired_add_mac_blacklist_item(NMSettingWired *setting, const char *mac); -void nm_setting_wired_remove_mac_blacklist_item(NMSettingWired *setting, guint32 idx); +NM_DEPRECATED_IN_1_48 +void nm_setting_wired_remove_mac_blacklist_item(NMSettingWired *setting, guint32 idx); +NM_DEPRECATED_IN_1_48 gboolean nm_setting_wired_remove_mac_blacklist_item_by_value(NMSettingWired *setting, const char *mac); -void nm_setting_wired_clear_mac_blacklist_items(NMSettingWired *setting); +NM_DEPRECATED_IN_1_48 +void nm_setting_wired_clear_mac_blacklist_items(NMSettingWired *setting); + +const char *const *nm_setting_wired_get_mac_address_denylist(NMSettingWired *setting); +guint32 nm_setting_wired_get_num_mac_denylist_items(NMSettingWired *setting); +const char *nm_setting_wired_get_mac_denylist_item(NMSettingWired *setting, guint32 idx); +gboolean nm_setting_wired_add_mac_denylist_item(NMSettingWired *setting, const char *mac); +void nm_setting_wired_remove_mac_denylist_item(NMSettingWired *setting, guint32 idx); +gboolean nm_setting_wired_remove_mac_denylist_item_by_value(NMSettingWired *setting, + const char *mac); +void nm_setting_wired_clear_mac_denylist_items(NMSettingWired *setting); guint32 nm_setting_wired_get_mtu(NMSettingWired *setting); diff --git a/src/libnmc-setting/nm-meta-setting-desc.c b/src/libnmc-setting/nm-meta-setting-desc.c index 84e553452a..c5a64c00cf 100644 --- a/src/libnmc-setting/nm-meta-setting-desc.c +++ b/src/libnmc-setting/nm-meta-setting-desc.c @@ -8059,6 +8059,7 @@ static const NMMetaPropertyInfo *const property_infos_WIRED[] = { ), PROPERTY_INFO_WITH_DESC (NM_SETTING_WIRED_MAC_ADDRESS_BLACKLIST, .property_type = &_pt_multilist, + .hide_if_default = TRUE, .property_typ_data = DEFINE_PROPERTY_TYP_DATA ( PROPERTY_TYP_DATA_SUBTYPE (multilist, .get_num_fcn_u32 = MULTILIST_GET_NUM_FCN_U32 (NMSettingWired, nm_setting_wired_get_num_mac_blacklist_items), @@ -8071,6 +8072,20 @@ static const NMMetaPropertyInfo *const property_infos_WIRED[] = { .list_items_doc_format = NM_META_PROPERTY_TYPE_FORMAT_MAC, ), ), + PROPERTY_INFO_WITH_DESC (NM_SETTING_WIRED_MAC_ADDRESS_DENYLIST, + .property_type = &_pt_multilist, + .property_typ_data = DEFINE_PROPERTY_TYP_DATA ( + PROPERTY_TYP_DATA_SUBTYPE (multilist, + .get_num_fcn_u = MULTILIST_GET_NUM_FCN_U (NMSettingWired, nm_setting_wired_get_num_mac_denylist_items), + .add_fcn = MULTILIST_ADD_FCN (NMSettingWired, nm_setting_wired_add_mac_denylist_item), + .remove_by_idx_fcn_u = MULTILIST_REMOVE_BY_IDX_FCN_U (NMSettingWired, nm_setting_wired_remove_mac_denylist_item), + .remove_by_value_fcn = MULTILIST_REMOVE_BY_VALUE_FCN (NMSettingWired, nm_setting_wired_remove_mac_denylist_item_by_value), + .validate2_fcn = _multilist_validate2_fcn_mac_addr, + .strsplit_plain = TRUE, + ), + .list_items_doc_format = NM_META_PROPERTY_TYPE_FORMAT_MAC, + ), + ), PROPERTY_INFO_WITH_DESC (NM_SETTING_WIRED_MTU, .is_cli_option = TRUE, .property_alias = "mtu", diff --git a/src/libnmc-setting/settings-docs.h.in b/src/libnmc-setting/settings-docs.h.in index b20a6e3cbd..7b2694d4e9 100644 --- a/src/libnmc-setting/settings-docs.h.in +++ b/src/libnmc-setting/settings-docs.h.in @@ -394,6 +394,7 @@ #define DESCRIBE_DOC_NM_SETTING_WIRED_GENERATE_MAC_ADDRESS_MASK N_("With \"cloned-mac-address\" setting \"random\" or \"stable\", by default all bits of the MAC address are scrambled and a locally-administered, unicast MAC address is created. This property allows to specify that certain bits are fixed. Note that the least significant bit of the first MAC address will always be unset to create a unicast MAC address. If the property is NULL, it is eligible to be overwritten by a default connection setting. If the value is still NULL or an empty string, the default is to create a locally-administered, unicast MAC address. If the value contains one MAC address, this address is used as mask. The set bits of the mask are to be filled with the current MAC address of the device, while the unset bits are subject to randomization. Setting \"FE:FF:FF:00:00:00\" means to preserve the OUI of the current MAC address and only randomize the lower 3 bytes using the \"random\" or \"stable\" algorithm. If the value contains one additional MAC address after the mask, this address is used instead of the current MAC address to fill the bits that shall not be randomized. For example, a value of \"FE:FF:FF:00:00:00 68:F7:28:00:00:00\" will set the OUI of the MAC address to 68:F7:28, while the lower bits are randomized. A value of \"02:00:00:00:00:00 00:00:00:00:00:00\" will create a fully scrambled globally-administered, burned-in MAC address. If the value contains more than one additional MAC addresses, one of them is chosen randomly. For example, \"02:00:00:00:00:00 00:00:00:00:00:00 02:00:00:00:00:00\" will create a fully scrambled MAC address, randomly locally or globally administered.") #define DESCRIBE_DOC_NM_SETTING_WIRED_MAC_ADDRESS N_("If specified, this connection will only apply to the Ethernet device whose permanent MAC address matches. This property does not change the MAC address of the device (i.e. MAC spoofing).") #define DESCRIBE_DOC_NM_SETTING_WIRED_MAC_ADDRESS_BLACKLIST N_("If specified, this connection will never apply to the Ethernet device whose permanent MAC address matches an address in the list. Each MAC address is in the standard hex-digits-and-colons notation (00:11:22:33:44:55).") +#define DESCRIBE_DOC_NM_SETTING_WIRED_MAC_ADDRESS_DENYLIST N_("If specified, this connection will never apply to the Ethernet device whose permanent MAC address matches an address in the list. Each MAC address is in the standard hex-digits-and-colons notation (00:11:22:33:44:55).") #define DESCRIBE_DOC_NM_SETTING_WIRED_MTU N_("If non-zero, only transmit packets of the specified size or smaller, breaking larger packets up into multiple Ethernet frames.") #define DESCRIBE_DOC_NM_SETTING_WIRED_PORT N_("Specific port type to use if the device supports multiple attachment methods. One of \"tp\" (Twisted Pair), \"aui\" (Attachment Unit Interface), \"bnc\" (Thin Ethernet) or \"mii\" (Media Independent Interface). If the device supports only one port type, this setting is ignored.") #define DESCRIBE_DOC_NM_SETTING_WIRED_S390_NETTYPE N_("s390 network device type; one of \"qeth\", \"lcs\", or \"ctc\", representing the different types of virtual network devices available on s390 systems.") diff --git a/src/nmcli/gen-metadata-nm-settings-nmcli.xml.in b/src/nmcli/gen-metadata-nm-settings-nmcli.xml.in index b38a235eef..3b9d6376a6 100644 --- a/src/nmcli/gen-metadata-nm-settings-nmcli.xml.in +++ b/src/nmcli/gen-metadata-nm-settings-nmcli.xml.in @@ -363,6 +363,9 @@ + >> connection.id:ethernet connection.uuid:UUID-ethernet-REPLACED-REPLACED-REPL @@ -6558,7 +6558,7 @@ connection.wait-activation-delay:-1 802-3-ethernet.mac-address: 802-3-ethernet.cloned-mac-address: 802-3-ethernet.generate-mac-address-mask: -802-3-ethernet.mac-address-blacklist: +802-3-ethernet.mac-address-denylist: 802-3-ethernet.mtu:auto 802-3-ethernet.s390-subchannels: 802-3-ethernet.s390-nettype: @@ -6661,12 +6661,12 @@ GENERAL.ZONE: GENERAL.MASTER-PATH: <<< -size: 3568 +size: 3567 location: src/tests/client/test-client.py:test_003()/125 cmd: $NMCLI --terse con s ethernet lang: pl_PL.UTF-8 returncode: 0 -stdout: 3416 bytes +stdout: 3415 bytes >>> connection.id:ethernet connection.uuid:UUID-ethernet-REPLACED-REPLACED-REPL @@ -6705,7 +6705,7 @@ connection.wait-activation-delay:-1 802-3-ethernet.mac-address: 802-3-ethernet.cloned-mac-address: 802-3-ethernet.generate-mac-address-mask: -802-3-ethernet.mac-address-blacklist: +802-3-ethernet.mac-address-denylist: 802-3-ethernet.mtu:auto 802-3-ethernet.s390-subchannels: 802-3-ethernet.s390-nettype: @@ -6808,12 +6808,12 @@ GENERAL.ZONE: GENERAL.MASTER-PATH: <<< -size: 3208 +size: 3207 location: src/tests/client/test-client.py:test_003()/126 cmd: $NMCLI --terse c s /org/freedesktop/NetworkManager/ActiveConnection/1 lang: C returncode: 0 -stdout: 3026 bytes +stdout: 3025 bytes >>> connection.id:ethernet connection.uuid:UUID-ethernet-REPLACED-REPLACED-REPL @@ -6852,7 +6852,7 @@ connection.wait-activation-delay:-1 802-3-ethernet.mac-address: 802-3-ethernet.cloned-mac-address: 802-3-ethernet.generate-mac-address-mask: -802-3-ethernet.mac-address-blacklist: +802-3-ethernet.mac-address-denylist: 802-3-ethernet.mtu:auto 802-3-ethernet.s390-subchannels: 802-3-ethernet.s390-nettype: @@ -6941,12 +6941,12 @@ GENERAL.ZONE: GENERAL.MASTER-PATH: <<< -size: 3218 +size: 3217 location: src/tests/client/test-client.py:test_003()/127 cmd: $NMCLI --terse c s /org/freedesktop/NetworkManager/ActiveConnection/1 lang: pl_PL.UTF-8 returncode: 0 -stdout: 3026 bytes +stdout: 3025 bytes >>> connection.id:ethernet connection.uuid:UUID-ethernet-REPLACED-REPLACED-REPL @@ -6985,7 +6985,7 @@ connection.wait-activation-delay:-1 802-3-ethernet.mac-address: 802-3-ethernet.cloned-mac-address: 802-3-ethernet.generate-mac-address-mask: -802-3-ethernet.mac-address-blacklist: +802-3-ethernet.mac-address-denylist: 802-3-ethernet.mtu:auto 802-3-ethernet.s390-subchannels: 802-3-ethernet.s390-nettype: @@ -7280,12 +7280,12 @@ UUID-con-gsm3-REPLACED-REPLACED-REPL:gsm UUID-con-xx1-REPLACED-REPLACED-REPLA:802-3-ethernet <<< -size: 3570 +size: 3569 location: src/tests/client/test-client.py:test_003()/134 cmd: $NMCLI --terse --color yes con s ethernet lang: C returncode: 0 -stdout: 3416 bytes +stdout: 3415 bytes >>> connection.id:ethernet connection.uuid:UUID-ethernet-REPLACED-REPLACED-REPL @@ -7324,7 +7324,7 @@ connection.wait-activation-delay:-1 802-3-ethernet.mac-address: 802-3-ethernet.cloned-mac-address: 802-3-ethernet.generate-mac-address-mask: -802-3-ethernet.mac-address-blacklist: +802-3-ethernet.mac-address-denylist: 802-3-ethernet.mtu:auto 802-3-ethernet.s390-subchannels: 802-3-ethernet.s390-nettype: @@ -7427,12 +7427,12 @@ GENERAL.ZONE: GENERAL.MASTER-PATH: <<< -size: 3580 +size: 3579 location: src/tests/client/test-client.py:test_003()/135 cmd: $NMCLI --terse --color yes con s ethernet lang: pl_PL.UTF-8 returncode: 0 -stdout: 3416 bytes +stdout: 3415 bytes >>> connection.id:ethernet connection.uuid:UUID-ethernet-REPLACED-REPLACED-REPL @@ -7471,7 +7471,7 @@ connection.wait-activation-delay:-1 802-3-ethernet.mac-address: 802-3-ethernet.cloned-mac-address: 802-3-ethernet.generate-mac-address-mask: -802-3-ethernet.mac-address-blacklist: +802-3-ethernet.mac-address-denylist: 802-3-ethernet.mtu:auto 802-3-ethernet.s390-subchannels: 802-3-ethernet.s390-nettype: @@ -7574,12 +7574,12 @@ GENERAL.ZONE: GENERAL.MASTER-PATH: <<< -size: 3220 +size: 3219 location: src/tests/client/test-client.py:test_003()/136 cmd: $NMCLI --terse --color yes c s /org/freedesktop/NetworkManager/ActiveConnection/1 lang: C returncode: 0 -stdout: 3026 bytes +stdout: 3025 bytes >>> connection.id:ethernet connection.uuid:UUID-ethernet-REPLACED-REPLACED-REPL @@ -7618,7 +7618,7 @@ connection.wait-activation-delay:-1 802-3-ethernet.mac-address: 802-3-ethernet.cloned-mac-address: 802-3-ethernet.generate-mac-address-mask: -802-3-ethernet.mac-address-blacklist: +802-3-ethernet.mac-address-denylist: 802-3-ethernet.mtu:auto 802-3-ethernet.s390-subchannels: 802-3-ethernet.s390-nettype: @@ -7707,12 +7707,12 @@ GENERAL.ZONE: GENERAL.MASTER-PATH: <<< -size: 3230 +size: 3229 location: src/tests/client/test-client.py:test_003()/137 cmd: $NMCLI --terse --color yes c s /org/freedesktop/NetworkManager/ActiveConnection/1 lang: pl_PL.UTF-8 returncode: 0 -stdout: 3026 bytes +stdout: 3025 bytes >>> connection.id:ethernet connection.uuid:UUID-ethernet-REPLACED-REPLACED-REPL @@ -7751,7 +7751,7 @@ connection.wait-activation-delay:-1 802-3-ethernet.mac-address: 802-3-ethernet.cloned-mac-address: 802-3-ethernet.generate-mac-address-mask: -802-3-ethernet.mac-address-blacklist: +802-3-ethernet.mac-address-denylist: 802-3-ethernet.mtu:auto 802-3-ethernet.s390-subchannels: 802-3-ethernet.s390-nettype: @@ -8050,18 +8050,18 @@ UUID-con-gsm3-REPLACED-REPLACED-REPL gsm UUID-con-xx1-REPLACED-REPLACED-REPLA ethernet <<< -size: 4485 +size: 4483 location: src/tests/client/test-client.py:test_003()/144 cmd: $NMCLI --mode tabular con s ethernet lang: C returncode: 0 -stdout: 4336 bytes +stdout: 4334 bytes >>> name id uuid stable-id type interface-name autoconnect autoconnect-priority autoconnect-retries multi-connect auth-retries timestamp permissions zone controller master slave-type port-type autoconnect-slaves autoconnect-ports down-on-poweroff secondaries gateway-ping-timeout metered lldp mdns llmnr dns-over-tls mptcp-flags wait-device-timeout wait-activation-delay connection ethernet UUID-ethernet-REPLACED-REPLACED-REPL -- 802-3-ethernet -- yes 0 -1 (default) 0 (default) -1 0 -- -- -- -- -- -- -1 (default) -1 (default) -1 (default) -- 0 unknown default -1 (default) -1 (default) -1 (default) 0x0 (default) -1 -1 -name port speed duplex auto-negotiate mac-address cloned-mac-address generate-mac-address-mask mac-address-blacklist mtu s390-subchannels s390-nettype s390-options wake-on-lan wake-on-lan-password accept-all-mac-addresses -802-3-ethernet -- 0 -- no -- -- -- -- auto -- -- -- default -- -1 (default) +name port speed duplex auto-negotiate mac-address cloned-mac-address generate-mac-address-mask mac-address-denylist mtu s390-subchannels s390-nettype s390-options wake-on-lan wake-on-lan-password accept-all-mac-addresses +802-3-ethernet -- 0 -- no -- -- -- -- auto -- -- -- default -- -1 (default) name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules replace-local-rule dhcp-send-release ignore-auto-routes ignore-auto-dns dhcp-client-id dhcp-iaid dhcp-dscp dhcp-timeout dhcp-send-hostname dhcp-hostname dhcp-fqdn dhcp-hostname-flags never-default may-fail required-timeout dad-timeout dhcp-vendor-class-identifier link-local dhcp-reject-servers auto-route-ext-gw ipv4 auto -- -- -- 0 -- -- -- -1 0 (unspec) -- -1 (default) -1 (default) no no -- -- -- 0 (default) yes -- -- 0x0 (none) no yes -1 (default) -1 (default) -- 0 (default) -- -1 (default) @@ -8081,18 +8081,18 @@ GENERAL ethernet UUID-ethernet-REPLACED-REPLACED-REPL eth0 eth0 deac <<< -size: 4535 +size: 4533 location: src/tests/client/test-client.py:test_003()/145 cmd: $NMCLI --mode tabular con s ethernet lang: pl_PL.UTF-8 returncode: 0 -stdout: 4376 bytes +stdout: 4374 bytes >>> name id uuid stable-id type interface-name autoconnect autoconnect-priority autoconnect-retries multi-connect auth-retries timestamp permissions zone controller master slave-type port-type autoconnect-slaves autoconnect-ports down-on-poweroff secondaries gateway-ping-timeout metered lldp mdns llmnr dns-over-tls mptcp-flags wait-device-timeout wait-activation-delay connection ethernet UUID-ethernet-REPLACED-REPLACED-REPL -- 802-3-ethernet -- tak 0 -1 (default) 0 (default) -1 0 -- -- -- -- -- -- -1 (default) -1 (default) -1 (default) -- 0 nieznane default -1 (default) -1 (default) -1 (default) 0x0 (default) -1 -1 -name port speed duplex auto-negotiate mac-address cloned-mac-address generate-mac-address-mask mac-address-blacklist mtu s390-subchannels s390-nettype s390-options wake-on-lan wake-on-lan-password accept-all-mac-addresses -802-3-ethernet -- 0 -- nie -- -- -- -- automatyczne -- -- -- default -- -1 (default) +name port speed duplex auto-negotiate mac-address cloned-mac-address generate-mac-address-mask mac-address-denylist mtu s390-subchannels s390-nettype s390-options wake-on-lan wake-on-lan-password accept-all-mac-addresses +802-3-ethernet -- 0 -- nie -- -- -- -- automatyczne -- -- -- default -- -1 (default) name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules replace-local-rule dhcp-send-release ignore-auto-routes ignore-auto-dns dhcp-client-id dhcp-iaid dhcp-dscp dhcp-timeout dhcp-send-hostname dhcp-hostname dhcp-fqdn dhcp-hostname-flags never-default may-fail required-timeout dad-timeout dhcp-vendor-class-identifier link-local dhcp-reject-servers auto-route-ext-gw ipv4 auto -- -- -- 0 -- -- -- -1 0 (unspec) -- -1 (default) -1 (default) nie nie -- -- -- 0 (default) tak -- -- 0x0 (none) nie tak -1 (default) -1 (default) -- 0 (default) -- -1 (default) @@ -8112,18 +8112,18 @@ GENERAL ethernet UUID-ethernet-REPLACED-REPLACED-REPL eth0 eth0 deza <<< -size: 4023 +size: 4021 location: src/tests/client/test-client.py:test_003()/146 cmd: $NMCLI --mode tabular c s /org/freedesktop/NetworkManager/ActiveConnection/1 lang: C returncode: 0 -stdout: 3834 bytes +stdout: 3832 bytes >>> name id uuid stable-id type interface-name autoconnect autoconnect-priority autoconnect-retries multi-connect auth-retries timestamp permissions zone controller master slave-type port-type autoconnect-slaves autoconnect-ports down-on-poweroff secondaries gateway-ping-timeout metered lldp mdns llmnr dns-over-tls mptcp-flags wait-device-timeout wait-activation-delay connection ethernet UUID-ethernet-REPLACED-REPLACED-REPL -- 802-3-ethernet -- yes 0 -1 (default) 0 (default) -1 0 -- -- -- -- -- -- -1 (default) -1 (default) -1 (default) -- 0 unknown default -1 (default) -1 (default) -1 (default) 0x0 (default) -1 -1 -name port speed duplex auto-negotiate mac-address cloned-mac-address generate-mac-address-mask mac-address-blacklist mtu s390-subchannels s390-nettype s390-options wake-on-lan wake-on-lan-password accept-all-mac-addresses -802-3-ethernet -- 0 -- no -- -- -- -- auto -- -- -- default -- -1 (default) +name port speed duplex auto-negotiate mac-address cloned-mac-address generate-mac-address-mask mac-address-denylist mtu s390-subchannels s390-nettype s390-options wake-on-lan wake-on-lan-password accept-all-mac-addresses +802-3-ethernet -- 0 -- no -- -- -- -- auto -- -- -- default -- -1 (default) name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules replace-local-rule dhcp-send-release ignore-auto-routes ignore-auto-dns dhcp-client-id dhcp-iaid dhcp-dscp dhcp-timeout dhcp-send-hostname dhcp-hostname dhcp-fqdn dhcp-hostname-flags never-default may-fail required-timeout dad-timeout dhcp-vendor-class-identifier link-local dhcp-reject-servers auto-route-ext-gw ipv4 auto -- -- -- 0 -- -- -- -1 0 (unspec) -- -1 (default) -1 (default) no no -- -- -- 0 (default) yes -- -- 0x0 (none) no yes -1 (default) -1 (default) -- 0 (default) -- -1 (default) @@ -8139,18 +8139,18 @@ GENERAL ethernet UUID-ethernet-REPLACED-REPLACED-REPL eth0 eth0 deac <<< -size: 4071 +size: 4069 location: src/tests/client/test-client.py:test_003()/147 cmd: $NMCLI --mode tabular c s /org/freedesktop/NetworkManager/ActiveConnection/1 lang: pl_PL.UTF-8 returncode: 0 -stdout: 3872 bytes +stdout: 3870 bytes >>> name id uuid stable-id type interface-name autoconnect autoconnect-priority autoconnect-retries multi-connect auth-retries timestamp permissions zone controller master slave-type port-type autoconnect-slaves autoconnect-ports down-on-poweroff secondaries gateway-ping-timeout metered lldp mdns llmnr dns-over-tls mptcp-flags wait-device-timeout wait-activation-delay connection ethernet UUID-ethernet-REPLACED-REPLACED-REPL -- 802-3-ethernet -- tak 0 -1 (default) 0 (default) -1 0 -- -- -- -- -- -- -1 (default) -1 (default) -1 (default) -- 0 nieznane default -1 (default) -1 (default) -1 (default) 0x0 (default) -1 -1 -name port speed duplex auto-negotiate mac-address cloned-mac-address generate-mac-address-mask mac-address-blacklist mtu s390-subchannels s390-nettype s390-options wake-on-lan wake-on-lan-password accept-all-mac-addresses -802-3-ethernet -- 0 -- nie -- -- -- -- automatyczne -- -- -- default -- -1 (default) +name port speed duplex auto-negotiate mac-address cloned-mac-address generate-mac-address-mask mac-address-denylist mtu s390-subchannels s390-nettype s390-options wake-on-lan wake-on-lan-password accept-all-mac-addresses +802-3-ethernet -- 0 -- nie -- -- -- -- automatyczne -- -- -- default -- -1 (default) name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules replace-local-rule dhcp-send-release ignore-auto-routes ignore-auto-dns dhcp-client-id dhcp-iaid dhcp-dscp dhcp-timeout dhcp-send-hostname dhcp-hostname dhcp-fqdn dhcp-hostname-flags never-default may-fail required-timeout dad-timeout dhcp-vendor-class-identifier link-local dhcp-reject-servers auto-route-ext-gw ipv4 auto -- -- -- 0 -- -- -- -1 0 (unspec) -- -1 (default) -1 (default) nie nie -- -- -- 0 (default) tak -- -- 0x0 (none) nie tak -1 (default) -1 (default) -- 0 (default) -- -1 (default) @@ -8302,18 +8302,18 @@ UUID-con-gsm3-REPLACED-REPLACED-REPL gsm UUID-con-xx1-REPLACED-REPLACED-REPLA ethernet <<< -size: 4497 +size: 4495 location: src/tests/client/test-client.py:test_003()/154 cmd: $NMCLI --mode tabular --color yes con s ethernet lang: C returncode: 0 -stdout: 4336 bytes +stdout: 4334 bytes >>> name id uuid stable-id type interface-name autoconnect autoconnect-priority autoconnect-retries multi-connect auth-retries timestamp permissions zone controller master slave-type port-type autoconnect-slaves autoconnect-ports down-on-poweroff secondaries gateway-ping-timeout metered lldp mdns llmnr dns-over-tls mptcp-flags wait-device-timeout wait-activation-delay connection ethernet UUID-ethernet-REPLACED-REPLACED-REPL -- 802-3-ethernet -- yes 0 -1 (default) 0 (default) -1 0 -- -- -- -- -- -- -1 (default) -1 (default) -1 (default) -- 0 unknown default -1 (default) -1 (default) -1 (default) 0x0 (default) -1 -1 -name port speed duplex auto-negotiate mac-address cloned-mac-address generate-mac-address-mask mac-address-blacklist mtu s390-subchannels s390-nettype s390-options wake-on-lan wake-on-lan-password accept-all-mac-addresses -802-3-ethernet -- 0 -- no -- -- -- -- auto -- -- -- default -- -1 (default) +name port speed duplex auto-negotiate mac-address cloned-mac-address generate-mac-address-mask mac-address-denylist mtu s390-subchannels s390-nettype s390-options wake-on-lan wake-on-lan-password accept-all-mac-addresses +802-3-ethernet -- 0 -- no -- -- -- -- auto -- -- -- default -- -1 (default) name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules replace-local-rule dhcp-send-release ignore-auto-routes ignore-auto-dns dhcp-client-id dhcp-iaid dhcp-dscp dhcp-timeout dhcp-send-hostname dhcp-hostname dhcp-fqdn dhcp-hostname-flags never-default may-fail required-timeout dad-timeout dhcp-vendor-class-identifier link-local dhcp-reject-servers auto-route-ext-gw ipv4 auto -- -- -- 0 -- -- -- -1 0 (unspec) -- -1 (default) -1 (default) no no -- -- -- 0 (default) yes -- -- 0x0 (none) no yes -1 (default) -1 (default) -- 0 (default) -- -1 (default) @@ -8333,18 +8333,18 @@ GENERAL ethernet UUID-ethernet-REPLACED-REPLACED-REPL eth0 eth0 deac <<< -size: 4547 +size: 4545 location: src/tests/client/test-client.py:test_003()/155 cmd: $NMCLI --mode tabular --color yes con s ethernet lang: pl_PL.UTF-8 returncode: 0 -stdout: 4376 bytes +stdout: 4374 bytes >>> name id uuid stable-id type interface-name autoconnect autoconnect-priority autoconnect-retries multi-connect auth-retries timestamp permissions zone controller master slave-type port-type autoconnect-slaves autoconnect-ports down-on-poweroff secondaries gateway-ping-timeout metered lldp mdns llmnr dns-over-tls mptcp-flags wait-device-timeout wait-activation-delay connection ethernet UUID-ethernet-REPLACED-REPLACED-REPL -- 802-3-ethernet -- tak 0 -1 (default) 0 (default) -1 0 -- -- -- -- -- -- -1 (default) -1 (default) -1 (default) -- 0 nieznane default -1 (default) -1 (default) -1 (default) 0x0 (default) -1 -1 -name port speed duplex auto-negotiate mac-address cloned-mac-address generate-mac-address-mask mac-address-blacklist mtu s390-subchannels s390-nettype s390-options wake-on-lan wake-on-lan-password accept-all-mac-addresses -802-3-ethernet -- 0 -- nie -- -- -- -- automatyczne -- -- -- default -- -1 (default) +name port speed duplex auto-negotiate mac-address cloned-mac-address generate-mac-address-mask mac-address-denylist mtu s390-subchannels s390-nettype s390-options wake-on-lan wake-on-lan-password accept-all-mac-addresses +802-3-ethernet -- 0 -- nie -- -- -- -- automatyczne -- -- -- default -- -1 (default) name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules replace-local-rule dhcp-send-release ignore-auto-routes ignore-auto-dns dhcp-client-id dhcp-iaid dhcp-dscp dhcp-timeout dhcp-send-hostname dhcp-hostname dhcp-fqdn dhcp-hostname-flags never-default may-fail required-timeout dad-timeout dhcp-vendor-class-identifier link-local dhcp-reject-servers auto-route-ext-gw ipv4 auto -- -- -- 0 -- -- -- -1 0 (unspec) -- -1 (default) -1 (default) nie nie -- -- -- 0 (default) tak -- -- 0x0 (none) nie tak -1 (default) -1 (default) -- 0 (default) -- -1 (default) @@ -8364,18 +8364,18 @@ GENERAL ethernet UUID-ethernet-REPLACED-REPLACED-REPL eth0 eth0 deza <<< -size: 4035 +size: 4033 location: src/tests/client/test-client.py:test_003()/156 cmd: $NMCLI --mode tabular --color yes c s /org/freedesktop/NetworkManager/ActiveConnection/1 lang: C returncode: 0 -stdout: 3834 bytes +stdout: 3832 bytes >>> name id uuid stable-id type interface-name autoconnect autoconnect-priority autoconnect-retries multi-connect auth-retries timestamp permissions zone controller master slave-type port-type autoconnect-slaves autoconnect-ports down-on-poweroff secondaries gateway-ping-timeout metered lldp mdns llmnr dns-over-tls mptcp-flags wait-device-timeout wait-activation-delay connection ethernet UUID-ethernet-REPLACED-REPLACED-REPL -- 802-3-ethernet -- yes 0 -1 (default) 0 (default) -1 0 -- -- -- -- -- -- -1 (default) -1 (default) -1 (default) -- 0 unknown default -1 (default) -1 (default) -1 (default) 0x0 (default) -1 -1 -name port speed duplex auto-negotiate mac-address cloned-mac-address generate-mac-address-mask mac-address-blacklist mtu s390-subchannels s390-nettype s390-options wake-on-lan wake-on-lan-password accept-all-mac-addresses -802-3-ethernet -- 0 -- no -- -- -- -- auto -- -- -- default -- -1 (default) +name port speed duplex auto-negotiate mac-address cloned-mac-address generate-mac-address-mask mac-address-denylist mtu s390-subchannels s390-nettype s390-options wake-on-lan wake-on-lan-password accept-all-mac-addresses +802-3-ethernet -- 0 -- no -- -- -- -- auto -- -- -- default -- -1 (default) name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules replace-local-rule dhcp-send-release ignore-auto-routes ignore-auto-dns dhcp-client-id dhcp-iaid dhcp-dscp dhcp-timeout dhcp-send-hostname dhcp-hostname dhcp-fqdn dhcp-hostname-flags never-default may-fail required-timeout dad-timeout dhcp-vendor-class-identifier link-local dhcp-reject-servers auto-route-ext-gw ipv4 auto -- -- -- 0 -- -- -- -1 0 (unspec) -- -1 (default) -1 (default) no no -- -- -- 0 (default) yes -- -- 0x0 (none) no yes -1 (default) -1 (default) -- 0 (default) -- -1 (default) @@ -8391,18 +8391,18 @@ GENERAL ethernet UUID-ethernet-REPLACED-REPLACED-REPL eth0 eth0 deac <<< -size: 4083 +size: 4081 location: src/tests/client/test-client.py:test_003()/157 cmd: $NMCLI --mode tabular --color yes c s /org/freedesktop/NetworkManager/ActiveConnection/1 lang: pl_PL.UTF-8 returncode: 0 -stdout: 3872 bytes +stdout: 3870 bytes >>> name id uuid stable-id type interface-name autoconnect autoconnect-priority autoconnect-retries multi-connect auth-retries timestamp permissions zone controller master slave-type port-type autoconnect-slaves autoconnect-ports down-on-poweroff secondaries gateway-ping-timeout metered lldp mdns llmnr dns-over-tls mptcp-flags wait-device-timeout wait-activation-delay connection ethernet UUID-ethernet-REPLACED-REPLACED-REPL -- 802-3-ethernet -- tak 0 -1 (default) 0 (default) -1 0 -- -- -- -- -- -- -1 (default) -1 (default) -1 (default) -- 0 nieznane default -1 (default) -1 (default) -1 (default) 0x0 (default) -1 -1 -name port speed duplex auto-negotiate mac-address cloned-mac-address generate-mac-address-mask mac-address-blacklist mtu s390-subchannels s390-nettype s390-options wake-on-lan wake-on-lan-password accept-all-mac-addresses -802-3-ethernet -- 0 -- nie -- -- -- -- automatyczne -- -- -- default -- -1 (default) +name port speed duplex auto-negotiate mac-address cloned-mac-address generate-mac-address-mask mac-address-denylist mtu s390-subchannels s390-nettype s390-options wake-on-lan wake-on-lan-password accept-all-mac-addresses +802-3-ethernet -- 0 -- nie -- -- -- -- automatyczne -- -- -- default -- -1 (default) name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules replace-local-rule dhcp-send-release ignore-auto-routes ignore-auto-dns dhcp-client-id dhcp-iaid dhcp-dscp dhcp-timeout dhcp-send-hostname dhcp-hostname dhcp-fqdn dhcp-hostname-flags never-default may-fail required-timeout dad-timeout dhcp-vendor-class-identifier link-local dhcp-reject-servers auto-route-ext-gw ipv4 auto -- -- -- 0 -- -- -- -1 0 (unspec) -- -1 (default) -1 (default) nie nie -- -- -- 0 (default) tak -- -- 0x0 (none) nie tak -1 (default) -1 (default) -- 0 (default) -- -1 (default) @@ -8570,12 +8570,12 @@ UUID-con-gsm3-REPLACED-REPLACED-REPL gsm UUID-con-xx1-REPLACED-REPLACED-REPLA ethernet <<< -size: 7199 +size: 7196 location: src/tests/client/test-client.py:test_003()/164 cmd: $NMCLI --mode tabular --pretty con s ethernet lang: C returncode: 0 -stdout: 7041 bytes +stdout: 7038 bytes >>> ========================================= Connection profile details (ethernet) @@ -8584,9 +8584,9 @@ name id uuid stable-id type ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- connection ethernet UUID-ethernet-REPLACED-REPLACED-REPL -- 802-3-ethernet -- yes 0 -1 (default) 0 (default) -1 0 -- -- -- -- -- -- -1 (default) -1 (default) -1 (default) -- 0 unknown default -1 (default) -1 (default) -1 (default) 0x0 (default) -1 -1 -name port speed duplex auto-negotiate mac-address cloned-mac-address generate-mac-address-mask mac-address-blacklist mtu s390-subchannels s390-nettype s390-options wake-on-lan wake-on-lan-password accept-all-mac-addresses ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -802-3-ethernet -- 0 -- no -- -- -- -- auto -- -- -- default -- -1 (default) +name port speed duplex auto-negotiate mac-address cloned-mac-address generate-mac-address-mask mac-address-denylist mtu s390-subchannels s390-nettype s390-options wake-on-lan wake-on-lan-password accept-all-mac-addresses +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +802-3-ethernet -- 0 -- no -- -- -- -- auto -- -- -- default -- -1 (default) name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules replace-local-rule dhcp-send-release ignore-auto-routes ignore-auto-dns dhcp-client-id dhcp-iaid dhcp-dscp dhcp-timeout dhcp-send-hostname dhcp-hostname dhcp-fqdn dhcp-hostname-flags never-default may-fail required-timeout dad-timeout dhcp-vendor-class-identifier link-local dhcp-reject-servers auto-route-ext-gw ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- @@ -8617,12 +8617,12 @@ GENERAL ethernet UUID-ethernet-REPLACED-REPLACED-REPL eth0 eth0 deac <<< -size: 7329 +size: 7326 location: src/tests/client/test-client.py:test_003()/165 cmd: $NMCLI --mode tabular --pretty con s ethernet lang: pl_PL.UTF-8 returncode: 0 -stdout: 7161 bytes +stdout: 7158 bytes >>> =========================================== Szczegóły profilu połączenia (ethernet) @@ -8631,9 +8631,9 @@ name id uuid stable-id type ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- connection ethernet UUID-ethernet-REPLACED-REPLACED-REPL -- 802-3-ethernet -- tak 0 -1 (default) 0 (default) -1 0 -- -- -- -- -- -- -1 (default) -1 (default) -1 (default) -- 0 nieznane default -1 (default) -1 (default) -1 (default) 0x0 (default) -1 -1 -name port speed duplex auto-negotiate mac-address cloned-mac-address generate-mac-address-mask mac-address-blacklist mtu s390-subchannels s390-nettype s390-options wake-on-lan wake-on-lan-password accept-all-mac-addresses ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ -802-3-ethernet -- 0 -- nie -- -- -- -- automatyczne -- -- -- default -- -1 (default) +name port speed duplex auto-negotiate mac-address cloned-mac-address generate-mac-address-mask mac-address-denylist mtu s390-subchannels s390-nettype s390-options wake-on-lan wake-on-lan-password accept-all-mac-addresses +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +802-3-ethernet -- 0 -- nie -- -- -- -- automatyczne -- -- -- default -- -1 (default) name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules replace-local-rule dhcp-send-release ignore-auto-routes ignore-auto-dns dhcp-client-id dhcp-iaid dhcp-dscp dhcp-timeout dhcp-send-hostname dhcp-hostname dhcp-fqdn dhcp-hostname-flags never-default may-fail required-timeout dad-timeout dhcp-vendor-class-identifier link-local dhcp-reject-servers auto-route-ext-gw ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- @@ -8664,12 +8664,12 @@ GENERAL ethernet UUID-ethernet-REPLACED-REPLACED-REPL eth0 eth0 deza <<< -size: 6281 +size: 6278 location: src/tests/client/test-client.py:test_003()/166 cmd: $NMCLI --mode tabular --pretty c s /org/freedesktop/NetworkManager/ActiveConnection/1 lang: C returncode: 0 -stdout: 6083 bytes +stdout: 6080 bytes >>> ========================================= Connection profile details (ethernet) @@ -8678,9 +8678,9 @@ name id uuid stable-id type ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- connection ethernet UUID-ethernet-REPLACED-REPLACED-REPL -- 802-3-ethernet -- yes 0 -1 (default) 0 (default) -1 0 -- -- -- -- -- -- -1 (default) -1 (default) -1 (default) -- 0 unknown default -1 (default) -1 (default) -1 (default) 0x0 (default) -1 -1 -name port speed duplex auto-negotiate mac-address cloned-mac-address generate-mac-address-mask mac-address-blacklist mtu s390-subchannels s390-nettype s390-options wake-on-lan wake-on-lan-password accept-all-mac-addresses ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -802-3-ethernet -- 0 -- no -- -- -- -- auto -- -- -- default -- -1 (default) +name port speed duplex auto-negotiate mac-address cloned-mac-address generate-mac-address-mask mac-address-denylist mtu s390-subchannels s390-nettype s390-options wake-on-lan wake-on-lan-password accept-all-mac-addresses +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +802-3-ethernet -- 0 -- no -- -- -- -- auto -- -- -- default -- -1 (default) name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules replace-local-rule dhcp-send-release ignore-auto-routes ignore-auto-dns dhcp-client-id dhcp-iaid dhcp-dscp dhcp-timeout dhcp-send-hostname dhcp-hostname dhcp-fqdn dhcp-hostname-flags never-default may-fail required-timeout dad-timeout dhcp-vendor-class-identifier link-local dhcp-reject-servers auto-route-ext-gw ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- @@ -8703,12 +8703,12 @@ GENERAL ethernet UUID-ethernet-REPLACED-REPLACED-REPL eth0 eth0 deac <<< -size: 6383 +size: 6380 location: src/tests/client/test-client.py:test_003()/167 cmd: $NMCLI --mode tabular --pretty c s /org/freedesktop/NetworkManager/ActiveConnection/1 lang: pl_PL.UTF-8 returncode: 0 -stdout: 6175 bytes +stdout: 6172 bytes >>> =========================================== Szczegóły profilu połączenia (ethernet) @@ -8717,9 +8717,9 @@ name id uuid stable-id type ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- connection ethernet UUID-ethernet-REPLACED-REPLACED-REPL -- 802-3-ethernet -- tak 0 -1 (default) 0 (default) -1 0 -- -- -- -- -- -- -1 (default) -1 (default) -1 (default) -- 0 nieznane default -1 (default) -1 (default) -1 (default) 0x0 (default) -1 -1 -name port speed duplex auto-negotiate mac-address cloned-mac-address generate-mac-address-mask mac-address-blacklist mtu s390-subchannels s390-nettype s390-options wake-on-lan wake-on-lan-password accept-all-mac-addresses ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ -802-3-ethernet -- 0 -- nie -- -- -- -- automatyczne -- -- -- default -- -1 (default) +name port speed duplex auto-negotiate mac-address cloned-mac-address generate-mac-address-mask mac-address-denylist mtu s390-subchannels s390-nettype s390-options wake-on-lan wake-on-lan-password accept-all-mac-addresses +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +802-3-ethernet -- 0 -- nie -- -- -- -- automatyczne -- -- -- default -- -1 (default) name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules replace-local-rule dhcp-send-release ignore-auto-routes ignore-auto-dns dhcp-client-id dhcp-iaid dhcp-dscp dhcp-timeout dhcp-send-hostname dhcp-hostname dhcp-fqdn dhcp-hostname-flags never-default may-fail required-timeout dad-timeout dhcp-vendor-class-identifier link-local dhcp-reject-servers auto-route-ext-gw ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- @@ -8918,12 +8918,12 @@ UUID-con-gsm3-REPLACED-REPLACED-REPL gsm UUID-con-xx1-REPLACED-REPLACED-REPLA ethernet <<< -size: 7211 +size: 7208 location: src/tests/client/test-client.py:test_003()/174 cmd: $NMCLI --mode tabular --pretty --color yes con s ethernet lang: C returncode: 0 -stdout: 7041 bytes +stdout: 7038 bytes >>> ========================================= Connection profile details (ethernet) @@ -8932,9 +8932,9 @@ name id uuid stable-id type ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- connection ethernet UUID-ethernet-REPLACED-REPLACED-REPL -- 802-3-ethernet -- yes 0 -1 (default) 0 (default) -1 0 -- -- -- -- -- -- -1 (default) -1 (default) -1 (default) -- 0 unknown default -1 (default) -1 (default) -1 (default) 0x0 (default) -1 -1 -name port speed duplex auto-negotiate mac-address cloned-mac-address generate-mac-address-mask mac-address-blacklist mtu s390-subchannels s390-nettype s390-options wake-on-lan wake-on-lan-password accept-all-mac-addresses ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -802-3-ethernet -- 0 -- no -- -- -- -- auto -- -- -- default -- -1 (default) +name port speed duplex auto-negotiate mac-address cloned-mac-address generate-mac-address-mask mac-address-denylist mtu s390-subchannels s390-nettype s390-options wake-on-lan wake-on-lan-password accept-all-mac-addresses +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +802-3-ethernet -- 0 -- no -- -- -- -- auto -- -- -- default -- -1 (default) name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules replace-local-rule dhcp-send-release ignore-auto-routes ignore-auto-dns dhcp-client-id dhcp-iaid dhcp-dscp dhcp-timeout dhcp-send-hostname dhcp-hostname dhcp-fqdn dhcp-hostname-flags never-default may-fail required-timeout dad-timeout dhcp-vendor-class-identifier link-local dhcp-reject-servers auto-route-ext-gw ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- @@ -8965,12 +8965,12 @@ GENERAL ethernet UUID-ethernet-REPLACED-REPLACED-REPL eth0 eth0 deac <<< -size: 7341 +size: 7338 location: src/tests/client/test-client.py:test_003()/175 cmd: $NMCLI --mode tabular --pretty --color yes con s ethernet lang: pl_PL.UTF-8 returncode: 0 -stdout: 7161 bytes +stdout: 7158 bytes >>> =========================================== Szczegóły profilu połączenia (ethernet) @@ -8979,9 +8979,9 @@ name id uuid stable-id type ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- connection ethernet UUID-ethernet-REPLACED-REPLACED-REPL -- 802-3-ethernet -- tak 0 -1 (default) 0 (default) -1 0 -- -- -- -- -- -- -1 (default) -1 (default) -1 (default) -- 0 nieznane default -1 (default) -1 (default) -1 (default) 0x0 (default) -1 -1 -name port speed duplex auto-negotiate mac-address cloned-mac-address generate-mac-address-mask mac-address-blacklist mtu s390-subchannels s390-nettype s390-options wake-on-lan wake-on-lan-password accept-all-mac-addresses ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ -802-3-ethernet -- 0 -- nie -- -- -- -- automatyczne -- -- -- default -- -1 (default) +name port speed duplex auto-negotiate mac-address cloned-mac-address generate-mac-address-mask mac-address-denylist mtu s390-subchannels s390-nettype s390-options wake-on-lan wake-on-lan-password accept-all-mac-addresses +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +802-3-ethernet -- 0 -- nie -- -- -- -- automatyczne -- -- -- default -- -1 (default) name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules replace-local-rule dhcp-send-release ignore-auto-routes ignore-auto-dns dhcp-client-id dhcp-iaid dhcp-dscp dhcp-timeout dhcp-send-hostname dhcp-hostname dhcp-fqdn dhcp-hostname-flags never-default may-fail required-timeout dad-timeout dhcp-vendor-class-identifier link-local dhcp-reject-servers auto-route-ext-gw ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- @@ -9012,12 +9012,12 @@ GENERAL ethernet UUID-ethernet-REPLACED-REPLACED-REPL eth0 eth0 deza <<< -size: 6293 +size: 6290 location: src/tests/client/test-client.py:test_003()/176 cmd: $NMCLI --mode tabular --pretty --color yes c s /org/freedesktop/NetworkManager/ActiveConnection/1 lang: C returncode: 0 -stdout: 6083 bytes +stdout: 6080 bytes >>> ========================================= Connection profile details (ethernet) @@ -9026,9 +9026,9 @@ name id uuid stable-id type ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- connection ethernet UUID-ethernet-REPLACED-REPLACED-REPL -- 802-3-ethernet -- yes 0 -1 (default) 0 (default) -1 0 -- -- -- -- -- -- -1 (default) -1 (default) -1 (default) -- 0 unknown default -1 (default) -1 (default) -1 (default) 0x0 (default) -1 -1 -name port speed duplex auto-negotiate mac-address cloned-mac-address generate-mac-address-mask mac-address-blacklist mtu s390-subchannels s390-nettype s390-options wake-on-lan wake-on-lan-password accept-all-mac-addresses ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -802-3-ethernet -- 0 -- no -- -- -- -- auto -- -- -- default -- -1 (default) +name port speed duplex auto-negotiate mac-address cloned-mac-address generate-mac-address-mask mac-address-denylist mtu s390-subchannels s390-nettype s390-options wake-on-lan wake-on-lan-password accept-all-mac-addresses +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +802-3-ethernet -- 0 -- no -- -- -- -- auto -- -- -- default -- -1 (default) name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules replace-local-rule dhcp-send-release ignore-auto-routes ignore-auto-dns dhcp-client-id dhcp-iaid dhcp-dscp dhcp-timeout dhcp-send-hostname dhcp-hostname dhcp-fqdn dhcp-hostname-flags never-default may-fail required-timeout dad-timeout dhcp-vendor-class-identifier link-local dhcp-reject-servers auto-route-ext-gw ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- @@ -9051,12 +9051,12 @@ GENERAL ethernet UUID-ethernet-REPLACED-REPLACED-REPL eth0 eth0 deac <<< -size: 6395 +size: 6392 location: src/tests/client/test-client.py:test_003()/177 cmd: $NMCLI --mode tabular --pretty --color yes c s /org/freedesktop/NetworkManager/ActiveConnection/1 lang: pl_PL.UTF-8 returncode: 0 -stdout: 6175 bytes +stdout: 6172 bytes >>> =========================================== Szczegóły profilu połączenia (ethernet) @@ -9065,9 +9065,9 @@ name id uuid stable-id type ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- connection ethernet UUID-ethernet-REPLACED-REPLACED-REPL -- 802-3-ethernet -- tak 0 -1 (default) 0 (default) -1 0 -- -- -- -- -- -- -1 (default) -1 (default) -1 (default) -- 0 nieznane default -1 (default) -1 (default) -1 (default) 0x0 (default) -1 -1 -name port speed duplex auto-negotiate mac-address cloned-mac-address generate-mac-address-mask mac-address-blacklist mtu s390-subchannels s390-nettype s390-options wake-on-lan wake-on-lan-password accept-all-mac-addresses ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ -802-3-ethernet -- 0 -- nie -- -- -- -- automatyczne -- -- -- default -- -1 (default) +name port speed duplex auto-negotiate mac-address cloned-mac-address generate-mac-address-mask mac-address-denylist mtu s390-subchannels s390-nettype s390-options wake-on-lan wake-on-lan-password accept-all-mac-addresses +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +802-3-ethernet -- 0 -- nie -- -- -- -- automatyczne -- -- -- default -- -1 (default) name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules replace-local-rule dhcp-send-release ignore-auto-routes ignore-auto-dns dhcp-client-id dhcp-iaid dhcp-dscp dhcp-timeout dhcp-send-hostname dhcp-hostname dhcp-fqdn dhcp-hostname-flags never-default may-fail required-timeout dad-timeout dhcp-vendor-class-identifier link-local dhcp-reject-servers auto-route-ext-gw ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- @@ -9822,7 +9822,7 @@ connection.wait-activation-delay: -1 802-3-ethernet.mac-address: -- 802-3-ethernet.cloned-mac-address: -- 802-3-ethernet.generate-mac-address-mask:-- -802-3-ethernet.mac-address-blacklist: -- +802-3-ethernet.mac-address-denylist: -- 802-3-ethernet.mtu: auto 802-3-ethernet.s390-subchannels: -- 802-3-ethernet.s390-nettype: -- @@ -9969,7 +9969,7 @@ connection.wait-activation-delay: -1 802-3-ethernet.mac-address: -- 802-3-ethernet.cloned-mac-address: -- 802-3-ethernet.generate-mac-address-mask:-- -802-3-ethernet.mac-address-blacklist: -- +802-3-ethernet.mac-address-denylist: -- 802-3-ethernet.mtu: automatyczne 802-3-ethernet.s390-subchannels: -- 802-3-ethernet.s390-nettype: -- @@ -10116,7 +10116,7 @@ connection.wait-activation-delay: -1 802-3-ethernet.mac-address: -- 802-3-ethernet.cloned-mac-address: -- 802-3-ethernet.generate-mac-address-mask:-- -802-3-ethernet.mac-address-blacklist: -- +802-3-ethernet.mac-address-denylist: -- 802-3-ethernet.mtu: auto 802-3-ethernet.s390-subchannels: -- 802-3-ethernet.s390-nettype: -- @@ -10249,7 +10249,7 @@ connection.wait-activation-delay: -1 802-3-ethernet.mac-address: -- 802-3-ethernet.cloned-mac-address: -- 802-3-ethernet.generate-mac-address-mask:-- -802-3-ethernet.mac-address-blacklist: -- +802-3-ethernet.mac-address-denylist: -- 802-3-ethernet.mtu: automatyczne 802-3-ethernet.s390-subchannels: -- 802-3-ethernet.s390-nettype: -- @@ -10796,7 +10796,7 @@ connection.wait-activation-delay: -1 802-3-ethernet.mac-address: -- 802-3-ethernet.cloned-mac-address: -- 802-3-ethernet.generate-mac-address-mask:-- -802-3-ethernet.mac-address-blacklist: -- +802-3-ethernet.mac-address-denylist: -- 802-3-ethernet.mtu: auto 802-3-ethernet.s390-subchannels: -- 802-3-ethernet.s390-nettype: -- @@ -10943,7 +10943,7 @@ connection.wait-activation-delay: -1 802-3-ethernet.mac-address: -- 802-3-ethernet.cloned-mac-address: -- 802-3-ethernet.generate-mac-address-mask:-- -802-3-ethernet.mac-address-blacklist: -- +802-3-ethernet.mac-address-denylist: -- 802-3-ethernet.mtu: automatyczne 802-3-ethernet.s390-subchannels: -- 802-3-ethernet.s390-nettype: -- @@ -11090,7 +11090,7 @@ connection.wait-activation-delay: -1 802-3-ethernet.mac-address: -- 802-3-ethernet.cloned-mac-address: -- 802-3-ethernet.generate-mac-address-mask:-- -802-3-ethernet.mac-address-blacklist: -- +802-3-ethernet.mac-address-denylist: -- 802-3-ethernet.mtu: auto 802-3-ethernet.s390-subchannels: -- 802-3-ethernet.s390-nettype: -- @@ -11223,7 +11223,7 @@ connection.wait-activation-delay: -1 802-3-ethernet.mac-address: -- 802-3-ethernet.cloned-mac-address: -- 802-3-ethernet.generate-mac-address-mask:-- -802-3-ethernet.mac-address-blacklist: -- +802-3-ethernet.mac-address-denylist: -- 802-3-ethernet.mtu: automatyczne 802-3-ethernet.s390-subchannels: -- 802-3-ethernet.s390-nettype: -- @@ -11812,7 +11812,7 @@ connection.wait-activation-delay: -1 802-3-ethernet.mac-address: -- 802-3-ethernet.cloned-mac-address: -- 802-3-ethernet.generate-mac-address-mask:-- -802-3-ethernet.mac-address-blacklist: -- +802-3-ethernet.mac-address-denylist: -- 802-3-ethernet.mtu: auto 802-3-ethernet.s390-subchannels: -- 802-3-ethernet.s390-nettype: -- @@ -11975,7 +11975,7 @@ connection.wait-activation-delay: -1 802-3-ethernet.mac-address: -- 802-3-ethernet.cloned-mac-address: -- 802-3-ethernet.generate-mac-address-mask:-- -802-3-ethernet.mac-address-blacklist: -- +802-3-ethernet.mac-address-denylist: -- 802-3-ethernet.mtu: automatyczne 802-3-ethernet.s390-subchannels: -- 802-3-ethernet.s390-nettype: -- @@ -12138,7 +12138,7 @@ connection.wait-activation-delay: -1 802-3-ethernet.mac-address: -- 802-3-ethernet.cloned-mac-address: -- 802-3-ethernet.generate-mac-address-mask:-- -802-3-ethernet.mac-address-blacklist: -- +802-3-ethernet.mac-address-denylist: -- 802-3-ethernet.mtu: auto 802-3-ethernet.s390-subchannels: -- 802-3-ethernet.s390-nettype: -- @@ -12283,7 +12283,7 @@ connection.wait-activation-delay: -1 802-3-ethernet.mac-address: -- 802-3-ethernet.cloned-mac-address: -- 802-3-ethernet.generate-mac-address-mask:-- -802-3-ethernet.mac-address-blacklist: -- +802-3-ethernet.mac-address-denylist: -- 802-3-ethernet.mtu: automatyczne 802-3-ethernet.s390-subchannels: -- 802-3-ethernet.s390-nettype: -- @@ -12904,7 +12904,7 @@ connection.wait-activation-delay: -1 802-3-ethernet.mac-address: -- 802-3-ethernet.cloned-mac-address: -- 802-3-ethernet.generate-mac-address-mask:-- -802-3-ethernet.mac-address-blacklist: -- +802-3-ethernet.mac-address-denylist: -- 802-3-ethernet.mtu: auto 802-3-ethernet.s390-subchannels: -- 802-3-ethernet.s390-nettype: -- @@ -13067,7 +13067,7 @@ connection.wait-activation-delay: -1 802-3-ethernet.mac-address: -- 802-3-ethernet.cloned-mac-address: -- 802-3-ethernet.generate-mac-address-mask:-- -802-3-ethernet.mac-address-blacklist: -- +802-3-ethernet.mac-address-denylist: -- 802-3-ethernet.mtu: automatyczne 802-3-ethernet.s390-subchannels: -- 802-3-ethernet.s390-nettype: -- @@ -13230,7 +13230,7 @@ connection.wait-activation-delay: -1 802-3-ethernet.mac-address: -- 802-3-ethernet.cloned-mac-address: -- 802-3-ethernet.generate-mac-address-mask:-- -802-3-ethernet.mac-address-blacklist: -- +802-3-ethernet.mac-address-denylist: -- 802-3-ethernet.mtu: auto 802-3-ethernet.s390-subchannels: -- 802-3-ethernet.s390-nettype: -- @@ -13375,7 +13375,7 @@ connection.wait-activation-delay: -1 802-3-ethernet.mac-address: -- 802-3-ethernet.cloned-mac-address: -- 802-3-ethernet.generate-mac-address-mask:-- -802-3-ethernet.mac-address-blacklist: -- +802-3-ethernet.mac-address-denylist: -- 802-3-ethernet.mtu: automatyczne 802-3-ethernet.s390-subchannels: -- 802-3-ethernet.s390-nettype: -- @@ -13910,12 +13910,12 @@ UUID:UUID-con-xx1-REPLACED-REPLACED-REPLA TYPE:802-3-ethernet <<< -size: 3575 +size: 3574 location: src/tests/client/test-client.py:test_003()/244 cmd: $NMCLI --mode multiline --terse con s ethernet lang: C returncode: 0 -stdout: 3416 bytes +stdout: 3415 bytes >>> connection.id:ethernet connection.uuid:UUID-ethernet-REPLACED-REPLACED-REPL @@ -13954,7 +13954,7 @@ connection.wait-activation-delay:-1 802-3-ethernet.mac-address: 802-3-ethernet.cloned-mac-address: 802-3-ethernet.generate-mac-address-mask: -802-3-ethernet.mac-address-blacklist: +802-3-ethernet.mac-address-denylist: 802-3-ethernet.mtu:auto 802-3-ethernet.s390-subchannels: 802-3-ethernet.s390-nettype: @@ -14057,12 +14057,12 @@ GENERAL.ZONE: GENERAL.MASTER-PATH: <<< -size: 3585 +size: 3584 location: src/tests/client/test-client.py:test_003()/245 cmd: $NMCLI --mode multiline --terse con s ethernet lang: pl_PL.UTF-8 returncode: 0 -stdout: 3416 bytes +stdout: 3415 bytes >>> connection.id:ethernet connection.uuid:UUID-ethernet-REPLACED-REPLACED-REPL @@ -14101,7 +14101,7 @@ connection.wait-activation-delay:-1 802-3-ethernet.mac-address: 802-3-ethernet.cloned-mac-address: 802-3-ethernet.generate-mac-address-mask: -802-3-ethernet.mac-address-blacklist: +802-3-ethernet.mac-address-denylist: 802-3-ethernet.mtu:auto 802-3-ethernet.s390-subchannels: 802-3-ethernet.s390-nettype: @@ -14204,12 +14204,12 @@ GENERAL.ZONE: GENERAL.MASTER-PATH: <<< -size: 3225 +size: 3224 location: src/tests/client/test-client.py:test_003()/246 cmd: $NMCLI --mode multiline --terse c s /org/freedesktop/NetworkManager/ActiveConnection/1 lang: C returncode: 0 -stdout: 3026 bytes +stdout: 3025 bytes >>> connection.id:ethernet connection.uuid:UUID-ethernet-REPLACED-REPLACED-REPL @@ -14248,7 +14248,7 @@ connection.wait-activation-delay:-1 802-3-ethernet.mac-address: 802-3-ethernet.cloned-mac-address: 802-3-ethernet.generate-mac-address-mask: -802-3-ethernet.mac-address-blacklist: +802-3-ethernet.mac-address-denylist: 802-3-ethernet.mtu:auto 802-3-ethernet.s390-subchannels: 802-3-ethernet.s390-nettype: @@ -14337,12 +14337,12 @@ GENERAL.ZONE: GENERAL.MASTER-PATH: <<< -size: 3235 +size: 3234 location: src/tests/client/test-client.py:test_003()/247 cmd: $NMCLI --mode multiline --terse c s /org/freedesktop/NetworkManager/ActiveConnection/1 lang: pl_PL.UTF-8 returncode: 0 -stdout: 3026 bytes +stdout: 3025 bytes >>> connection.id:ethernet connection.uuid:UUID-ethernet-REPLACED-REPLACED-REPL @@ -14381,7 +14381,7 @@ connection.wait-activation-delay:-1 802-3-ethernet.mac-address: 802-3-ethernet.cloned-mac-address: 802-3-ethernet.generate-mac-address-mask: -802-3-ethernet.mac-address-blacklist: +802-3-ethernet.mac-address-denylist: 802-3-ethernet.mtu:auto 802-3-ethernet.s390-subchannels: 802-3-ethernet.s390-nettype: @@ -14884,12 +14884,12 @@ UUID:UUID-con-xx1-REPLACED-REPLACED-REPLA TYPE:802-3-ethernet <<< -size: 3587 +size: 3586 location: src/tests/client/test-client.py:test_003()/254 cmd: $NMCLI --mode multiline --terse --color yes con s ethernet lang: C returncode: 0 -stdout: 3416 bytes +stdout: 3415 bytes >>> connection.id:ethernet connection.uuid:UUID-ethernet-REPLACED-REPLACED-REPL @@ -14928,7 +14928,7 @@ connection.wait-activation-delay:-1 802-3-ethernet.mac-address: 802-3-ethernet.cloned-mac-address: 802-3-ethernet.generate-mac-address-mask: -802-3-ethernet.mac-address-blacklist: +802-3-ethernet.mac-address-denylist: 802-3-ethernet.mtu:auto 802-3-ethernet.s390-subchannels: 802-3-ethernet.s390-nettype: @@ -15031,12 +15031,12 @@ GENERAL.ZONE: GENERAL.MASTER-PATH: <<< -size: 3597 +size: 3596 location: src/tests/client/test-client.py:test_003()/255 cmd: $NMCLI --mode multiline --terse --color yes con s ethernet lang: pl_PL.UTF-8 returncode: 0 -stdout: 3416 bytes +stdout: 3415 bytes >>> connection.id:ethernet connection.uuid:UUID-ethernet-REPLACED-REPLACED-REPL @@ -15075,7 +15075,7 @@ connection.wait-activation-delay:-1 802-3-ethernet.mac-address: 802-3-ethernet.cloned-mac-address: 802-3-ethernet.generate-mac-address-mask: -802-3-ethernet.mac-address-blacklist: +802-3-ethernet.mac-address-denylist: 802-3-ethernet.mtu:auto 802-3-ethernet.s390-subchannels: 802-3-ethernet.s390-nettype: @@ -15178,12 +15178,12 @@ GENERAL.ZONE: GENERAL.MASTER-PATH: <<< -size: 3237 +size: 3236 location: src/tests/client/test-client.py:test_003()/256 cmd: $NMCLI --mode multiline --terse --color yes c s /org/freedesktop/NetworkManager/ActiveConnection/1 lang: C returncode: 0 -stdout: 3026 bytes +stdout: 3025 bytes >>> connection.id:ethernet connection.uuid:UUID-ethernet-REPLACED-REPLACED-REPL @@ -15222,7 +15222,7 @@ connection.wait-activation-delay:-1 802-3-ethernet.mac-address: 802-3-ethernet.cloned-mac-address: 802-3-ethernet.generate-mac-address-mask: -802-3-ethernet.mac-address-blacklist: +802-3-ethernet.mac-address-denylist: 802-3-ethernet.mtu:auto 802-3-ethernet.s390-subchannels: 802-3-ethernet.s390-nettype: @@ -15311,12 +15311,12 @@ GENERAL.ZONE: GENERAL.MASTER-PATH: <<< -size: 3247 +size: 3246 location: src/tests/client/test-client.py:test_003()/257 cmd: $NMCLI --mode multiline --terse --color yes c s /org/freedesktop/NetworkManager/ActiveConnection/1 lang: pl_PL.UTF-8 returncode: 0 -stdout: 3026 bytes +stdout: 3025 bytes >>> connection.id:ethernet connection.uuid:UUID-ethernet-REPLACED-REPLACED-REPL @@ -15355,7 +15355,7 @@ connection.wait-activation-delay:-1 802-3-ethernet.mac-address: 802-3-ethernet.cloned-mac-address: 802-3-ethernet.generate-mac-address-mask: -802-3-ethernet.mac-address-blacklist: +802-3-ethernet.mac-address-denylist: 802-3-ethernet.mtu:auto 802-3-ethernet.s390-subchannels: 802-3-ethernet.s390-nettype: diff --git a/tools/test-networkmanager-service.py b/tools/test-networkmanager-service.py index 957f076f3a..b42687219f 100755 --- a/tools/test-networkmanager-service.py +++ b/tools/test-networkmanager-service.py @@ -54,6 +54,9 @@ ALIASED_PROPERTIES = { NM.SETTING_WIRELESS_MAC_ADDRESS_BLACKLIST, "mac-address-denylist" ) ], + NM.SETTING_WIRED_SETTING_NAME: [ + AliasedProperty(NM.SETTING_WIRED_MAC_ADDRESS_BLACKLIST, "mac-address-denylist") + ], } ############################################################################### From 0e283a8917ac84750af53de31d05a108f4f4d1c0 Mon Sep 17 00:00:00 2001 From: Jan Vaclav Date: Wed, 13 Mar 2024 12:51:17 +0100 Subject: [PATCH 5/5] all: use the new NMSettingWired mac-address-denylist property --- src/core/devices/nm-device-ethernet.c | 12 ++++++------ .../plugins/ifcfg-rh/nms-ifcfg-rh-writer.c | 2 +- src/libnm-client-impl/nm-device-ethernet.c | 14 +++++++------- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/core/devices/nm-device-ethernet.c b/src/core/devices/nm-device-ethernet.c index 0f7f9d65cd..8c2a964302 100644 --- a/src/core/devices/nm-device-ethernet.c +++ b/src/core/devices/nm-device-ethernet.c @@ -370,7 +370,7 @@ check_connection_compatible(NMDevice *device, if (s_wired) { const char *mac, *perm_hw_addr; gboolean try_mac = TRUE; - const char *const *mac_blacklist; + const char *const *mac_denylist; int i; if (!match_subchans(self, s_wired, &try_mac)) { @@ -390,17 +390,17 @@ check_connection_compatible(NMDevice *device, return FALSE; } - /* Check for MAC address blacklist */ - mac_blacklist = nm_setting_wired_get_mac_address_blacklist(s_wired); - for (i = 0; mac_blacklist[i]; i++) { - if (!nm_utils_hwaddr_valid(mac_blacklist[i], ETH_ALEN)) { + /* Check for MAC address denylist */ + mac_denylist = nm_setting_wired_get_mac_address_denylist(s_wired); + for (i = 0; mac_denylist[i]; i++) { + if (!nm_utils_hwaddr_valid(mac_denylist[i], ETH_ALEN)) { nm_utils_error_set_literal(error, NM_UTILS_ERROR_CONNECTION_AVAILABLE_TEMPORARY, "invalid MAC in blacklist"); return FALSE; } - if (nm_utils_hwaddr_matches(mac_blacklist[i], -1, perm_hw_addr, -1)) { + if (nm_utils_hwaddr_matches(mac_denylist[i], -1, perm_hw_addr, -1)) { nm_utils_error_set_literal(error, NM_UTILS_ERROR_CONNECTION_AVAILABLE_TEMPORARY, "permanent MAC address of device blacklisted"); diff --git a/src/core/settings/plugins/ifcfg-rh/nms-ifcfg-rh-writer.c b/src/core/settings/plugins/ifcfg-rh/nms-ifcfg-rh-writer.c index 904dd29938..f4598e2d13 100644 --- a/src/core/settings/plugins/ifcfg-rh/nms-ifcfg-rh-writer.c +++ b/src/core/settings/plugins/ifcfg-rh/nms-ifcfg-rh-writer.c @@ -1142,7 +1142,7 @@ write_wired_setting_impl(NMSettingWired *s_wired, shvarFile *ifcfg, gboolean is_ "GENERATE_MAC_ADDRESS_MASK", nm_setting_wired_get_generate_mac_address_mask(s_wired)); - macaddr_blacklist = nm_setting_wired_get_mac_address_blacklist(s_wired); + macaddr_blacklist = nm_setting_wired_get_mac_address_denylist(s_wired); if (macaddr_blacklist[0]) { gs_free char *blacklist_str = NULL; diff --git a/src/libnm-client-impl/nm-device-ethernet.c b/src/libnm-client-impl/nm-device-ethernet.c index 42b7262ddc..f51e49920c 100644 --- a/src/libnm-client-impl/nm-device-ethernet.c +++ b/src/libnm-client-impl/nm-device-ethernet.c @@ -195,7 +195,7 @@ connection_compatible(NMDevice *device, NMConnection *connection, GError **error if (s_wired) { const char *perm_addr, *s_mac; gboolean try_mac = TRUE; - const char *const *mac_blacklist; + const char *const *mac_denylist; int i; /* Check s390 subchannels */ @@ -232,20 +232,20 @@ connection_compatible(NMDevice *device, NMConnection *connection, GError **error return FALSE; } - /* Check for MAC address blacklist */ - mac_blacklist = nm_setting_wired_get_mac_address_blacklist(s_wired); - for (i = 0; mac_blacklist[i]; i++) { - if (!nm_utils_hwaddr_valid(mac_blacklist[i], ETH_ALEN)) { + /* Check for MAC address denylist */ + mac_denylist = nm_setting_wired_get_mac_address_denylist(s_wired); + for (i = 0; mac_denylist[i]; i++) { + if (!nm_utils_hwaddr_valid(mac_denylist[i], ETH_ALEN)) { g_warn_if_reached(); g_set_error(error, NM_DEVICE_ERROR, NM_DEVICE_ERROR_INCOMPATIBLE_CONNECTION, _("Invalid MAC in the blacklist: %s."), - mac_blacklist[i]); + mac_denylist[i]); return FALSE; } - if (nm_utils_hwaddr_matches(mac_blacklist[i], -1, perm_addr, -1)) { + if (nm_utils_hwaddr_matches(mac_denylist[i], -1, perm_addr, -1)) { g_set_error(error, NM_DEVICE_ERROR, NM_DEVICE_ERROR_INCOMPATIBLE_CONNECTION,