diff options
| author | Michael Biebl <biebl@debian.org> | 2024-08-09 18:57:15 +0200 |
|---|---|---|
| committer | Michael Biebl <biebl@debian.org> | 2024-08-09 18:57:15 +0200 |
| commit | e96d74409128c6a977e31f24fad9b267d2feb9a1 (patch) | |
| tree | 12dad71135c6c291de457568cb973208ea8a0024 /src/libnm-core-impl | |
| parent | 45a364c60a9d6d34e614c4f1f507c69336ad1e69 (diff) | |
New upstream version 1.48.8 upstream/1.48.8
Diffstat (limited to 'src/libnm-core-impl')
22 files changed, 494 insertions, 475 deletions
diff --git a/src/libnm-core-impl/nm-connection-private.h b/src/libnm-core-impl/nm-connection-private.h index 3b2c36fd..9f9007b6 100644 --- a/src/libnm-core-impl/nm-connection-private.h +++ b/src/libnm-core-impl/nm-connection-private.h @@ -15,15 +15,15 @@ NMSetting *_nm_connection_find_base_type_setting(NMConnection *connection); -const char *_nm_connection_detect_slave_type(NMConnection *connection, NMSetting **out_s_port); - -gboolean _nm_connection_detect_slave_type_full(NMSettingConnection *s_con, - NMConnection *connection, - const char **out_slave_type, - const char **out_normerr_slave_setting_type, - const char **out_normerr_missing_slave_type, - const char **out_normerr_missing_slave_type_port, - GError **error); +const char *_nm_connection_detect_port_type(NMConnection *connection, NMSetting **out_s_port); + +gboolean _nm_connection_detect_port_type_full(NMSettingConnection *s_con, + NMConnection *connection, + const char **out_port_type, + const char **out_normerr_port_setting_type, + const char **out_normerr_missing_port_type, + const char **out_normerr_missing_port_type_port, + GError **error); const char *_nm_connection_detect_bluetooth_type(NMConnection *self); diff --git a/src/libnm-core-impl/nm-connection.c b/src/libnm-core-impl/nm-connection.c index 15b489d6..95fe89a8 100644 --- a/src/libnm-core-impl/nm-connection.c +++ b/src/libnm-core-impl/nm-connection.c @@ -1047,11 +1047,11 @@ _nm_connection_detect_bluetooth_type(NMConnection *self) } const char * -_nm_connection_detect_slave_type(NMConnection *connection, NMSetting **out_s_port) +_nm_connection_detect_port_type(NMConnection *connection, NMSetting **out_s_port) { - NMConnectionPrivate *priv = NM_CONNECTION_GET_PRIVATE(connection); - const char *slave_type = NULL; - NMSetting *s_port = NULL; + NMConnectionPrivate *priv = NM_CONNECTION_GET_PRIVATE(connection); + const char *port_type = NULL; + NMSetting *s_port = NULL; int i; static const struct { NMMetaSettingType meta_type; @@ -1070,40 +1070,40 @@ _nm_connection_detect_slave_type(NMConnection *connection, NMSetting **out_s_por if (!setting) continue; - if (slave_type) { - /* there are more then one matching port types, cannot detect the slave type. */ - slave_type = NULL; - s_port = NULL; + if (port_type) { + /* there are more then one matching port types, cannot detect the port type. */ + port_type = NULL; + s_port = NULL; break; } - slave_type = infos[i].controller_type_name; - s_port = setting; + port_type = infos[i].controller_type_name; + s_port = setting; } if (out_s_port) *out_s_port = s_port; - return slave_type; + return port_type; } static gboolean -_normalize_connection_slave_type(NMConnection *self) +_normalize_connection_port_type(NMConnection *self) { NMSettingConnection *s_con = nm_connection_get_setting_connection(self); - const char *slave_type, *port_type; + const char *port_type, *port_setting_type; if (!s_con) return FALSE; if (!nm_setting_connection_get_controller(s_con)) return FALSE; - slave_type = nm_setting_connection_get_port_type(s_con); - if (slave_type) { - if (_nm_setting_slave_type_is_valid(slave_type, &port_type) && port_type) { + port_type = nm_setting_connection_get_port_type(s_con); + if (port_type) { + if (_nm_setting_port_type_is_valid(port_type, &port_setting_type) && port_setting_type) { NMSetting *s_port; - s_port = nm_connection_get_setting_by_name(self, port_type); + s_port = nm_connection_get_setting_by_name(self, port_setting_type); if (!s_port) { - GType p_type = nm_setting_lookup_type(port_type); + GType p_type = nm_setting_lookup_type(port_setting_type); g_return_val_if_fail(p_type, FALSE); nm_connection_add_setting(self, g_object_new(p_type, NULL)); @@ -1111,8 +1111,8 @@ _normalize_connection_slave_type(NMConnection *self) } } } else { - if ((slave_type = _nm_connection_detect_slave_type(self, NULL))) { - g_object_set(s_con, NM_SETTING_CONNECTION_PORT_TYPE, slave_type, NULL); + if ((port_type = _nm_connection_detect_port_type(self, NULL))) { + g_object_set(s_con, NM_SETTING_CONNECTION_PORT_TYPE, port_type, NULL); return TRUE; } } @@ -1762,23 +1762,23 @@ _normalize_required_settings(NMConnection *self) } static gboolean -_normalize_invalid_slave_port_settings(NMConnection *self) +_normalize_invalid_port_port_settings(NMConnection *self) { NMSettingConnection *s_con = nm_connection_get_setting_connection(self); - const char *slave_type; + const char *port_type; gboolean changed = FALSE; - slave_type = nm_setting_connection_get_port_type(s_con); + port_type = nm_setting_connection_get_port_type(s_con); - if (!nm_streq0(slave_type, NM_SETTING_BRIDGE_SETTING_NAME) + if (!nm_streq0(port_type, NM_SETTING_BRIDGE_SETTING_NAME) && _nm_connection_remove_setting(self, NM_TYPE_SETTING_BRIDGE_PORT)) changed = TRUE; - if (!nm_streq0(slave_type, NM_SETTING_BOND_SETTING_NAME) + if (!nm_streq0(port_type, NM_SETTING_BOND_SETTING_NAME) && _nm_connection_remove_setting(self, NM_TYPE_SETTING_BOND_PORT)) changed = TRUE; - if (!nm_streq0(slave_type, NM_SETTING_TEAM_SETTING_NAME) + if (!nm_streq0(port_type, NM_SETTING_TEAM_SETTING_NAME) && _nm_connection_remove_setting(self, NM_TYPE_SETTING_TEAM_PORT)) changed = TRUE; @@ -1890,10 +1890,10 @@ _nm_connection_verify(NMConnection *connection, GError **error) g_set_error_literal(&normalizable_error, NM_CONNECTION_ERROR, NM_CONNECTION_ERROR_MISSING_SETTING, - _("setting is required for non-slave connections")); + _("setting is required for non-port connections")); g_prefix_error(&normalizable_error, "%s: ", NM_SETTING_IP4_CONFIG_SETTING_NAME); - /* having a master without IP config was not a verify() error, accept + /* having a controller without IP config was not a verify() error, accept * it for backward compatibility. */ normalizable_error_type = NM_SETTING_VERIFY_NORMALIZABLE; } @@ -1903,9 +1903,9 @@ _nm_connection_verify(NMConnection *connection, GError **error) g_set_error_literal(&normalizable_error, NM_CONNECTION_ERROR, NM_CONNECTION_ERROR_INVALID_SETTING, - _("setting not allowed in slave connection")); + _("setting not allowed in port connection")); g_prefix_error(&normalizable_error, "%s: ", NM_SETTING_IP4_CONFIG_SETTING_NAME); - /* having a slave with IP config *was* and is a verify() error. */ + /* having a port with IP config *was* and is a verify() error. */ normalizable_error_type = NM_SETTING_VERIFY_NORMALIZABLE_ERROR; } } @@ -1915,10 +1915,10 @@ _nm_connection_verify(NMConnection *connection, GError **error) g_set_error_literal(&normalizable_error, NM_CONNECTION_ERROR, NM_CONNECTION_ERROR_MISSING_SETTING, - _("setting is required for non-slave connections")); + _("setting is required for non-port connections")); g_prefix_error(&normalizable_error, "%s: ", NM_SETTING_IP6_CONFIG_SETTING_NAME); - /* having a master without IP config was not a verify() error, accept + /* having a controller without IP config was not a verify() error, accept * it for backward compatibility. */ normalizable_error_type = NM_SETTING_VERIFY_NORMALIZABLE; } @@ -1928,9 +1928,9 @@ _nm_connection_verify(NMConnection *connection, GError **error) g_set_error_literal(&normalizable_error, NM_CONNECTION_ERROR, NM_CONNECTION_ERROR_INVALID_SETTING, - _("setting not allowed in slave connection")); + _("setting not allowed in port connection")); g_prefix_error(&normalizable_error, "%s: ", NM_SETTING_IP6_CONFIG_SETTING_NAME); - /* having a slave with IP config *was* and is a verify() error. */ + /* having a port with IP config *was* and is a verify() error. */ normalizable_error_type = NM_SETTING_VERIFY_NORMALIZABLE_ERROR; } } @@ -1940,10 +1940,10 @@ _nm_connection_verify(NMConnection *connection, GError **error) g_set_error_literal(&normalizable_error, NM_CONNECTION_ERROR, NM_CONNECTION_ERROR_MISSING_SETTING, - _("setting is required for non-slave connections")); + _("setting is required for non-port connections")); g_prefix_error(&normalizable_error, "%s: ", NM_SETTING_PROXY_SETTING_NAME); - /* having a master without proxy config was not a verify() error, accept + /* having a controller without proxy config was not a verify() error, accept * it for backward compatibility. */ normalizable_error_type = NM_SETTING_VERIFY_NORMALIZABLE; } @@ -1953,9 +1953,9 @@ _nm_connection_verify(NMConnection *connection, GError **error) g_set_error_literal(&normalizable_error, NM_CONNECTION_ERROR, NM_CONNECTION_ERROR_INVALID_SETTING, - _("setting not allowed in slave connection")); + _("setting not allowed in port connection")); g_prefix_error(&normalizable_error, "%s: ", NM_SETTING_PROXY_SETTING_NAME); - /* having a slave with proxy config *was* and is a verify() error. */ + /* having a port with proxy config *was* and is a verify() error. */ normalizable_error_type = NM_SETTING_VERIFY_NORMALIZABLE_ERROR; } } @@ -2026,11 +2026,11 @@ _connection_normalize(NMConnection *connection, was_modified |= _normalize_connection_uuid(connection); was_modified |= _normalize_connection_type(connection); - was_modified |= _normalize_connection_slave_type(connection); + was_modified |= _normalize_connection_port_type(connection); was_modified |= _normalize_connection_secondaries(connection); was_modified |= _normalize_connection(connection); was_modified |= _normalize_required_settings(connection); - was_modified |= _normalize_invalid_slave_port_settings(connection); + was_modified |= _normalize_invalid_port_port_settings(connection); was_modified |= _normalize_ip_config(connection, parameters); was_modified |= _normalize_ethernet_link_neg(connection); was_modified |= _normalize_infiniband(connection); diff --git a/src/libnm-core-impl/nm-keyfile.c b/src/libnm-core-impl/nm-keyfile.c index 078ea5d7..8dadf3cd 100644 --- a/src/libnm-core-impl/nm-keyfile.c +++ b/src/libnm-core-impl/nm-keyfile.c @@ -233,7 +233,7 @@ _secret_flags_persist_secret(NMSettingSecretFlags flags) /*****************************************************************************/ /* Some setting properties also contain setting names, such as * NMSettingConnection's 'type' property (which specifies the base type of the - * connection, e.g. ethernet or wifi) or 'slave-type' (specifies type of slave + * connection, e.g. ethernet or wifi) or 'port-type' (specifies type of port * connection, e.g. bond or bridge). This function handles translating those * properties' values to the real setting name if they are an alias. */ @@ -4074,6 +4074,16 @@ write_setting_value(KeyfileWriterInfo *info, return; } + /* Don't write offensive terms that are already deprecated as the new inclusive terms + * are being written. + */ + if (NM_IN_STRSET(key, + NM_SETTING_CONNECTION_AUTOCONNECT_SLAVES, + NM_SETTING_CONNECTION_MASTER, + NM_SETTING_CONNECTION_SLAVE_TYPE, + NM_SETTING_WIRED_MAC_ADDRESS_BLACKLIST)) + return; + value = (GValue){0}; g_value_init(&value, G_PARAM_SPEC_VALUE_TYPE(property_info->param_spec)); diff --git a/src/libnm-core-impl/nm-setting-6lowpan.c b/src/libnm-core-impl/nm-setting-6lowpan.c index d318ab00..1da30062 100644 --- a/src/libnm-core-impl/nm-setting-6lowpan.c +++ b/src/libnm-core-impl/nm-setting-6lowpan.c @@ -87,24 +87,24 @@ verify(NMSetting *setting, NMConnection *connection, GError **error) } if (nm_utils_is_uuid(priv->parent)) { - /* If we have an NMSettingConnection:master with slave-type="6lowpan", + /* If we have an NMSettingConnection:controller with port-type="6lowpan", * then it must be the same UUID. */ if (s_con) { - const char *master = NULL, *slave_type = NULL; + const char *controller = NULL, *port_type = NULL; - slave_type = nm_setting_connection_get_port_type(s_con); - if (!g_strcmp0(slave_type, NM_SETTING_6LOWPAN_SETTING_NAME)) - master = nm_setting_connection_get_controller(s_con); + port_type = nm_setting_connection_get_port_type(s_con); + if (!g_strcmp0(port_type, NM_SETTING_6LOWPAN_SETTING_NAME)) + controller = nm_setting_connection_get_controller(s_con); - if (master && g_strcmp0(priv->parent, master) != 0) { + if (controller && g_strcmp0(priv->parent, controller) != 0) { g_set_error(error, NM_CONNECTION_ERROR, NM_CONNECTION_ERROR_INVALID_PROPERTY, _("'%s' value doesn't match '%s=%s'"), priv->parent, NM_SETTING_CONNECTION_CONTROLLER, - master); + controller); g_prefix_error(error, "%s.%s: ", NM_SETTING_6LOWPAN_SETTING_NAME, diff --git a/src/libnm-core-impl/nm-setting-bond-port.c b/src/libnm-core-impl/nm-setting-bond-port.c index 342d6dd0..4f1270a8 100644 --- a/src/libnm-core-impl/nm-setting-bond-port.c +++ b/src/libnm-core-impl/nm-setting-bond-port.c @@ -89,7 +89,7 @@ verify(NMSetting *setting, NMConnection *connection, GError **error) { if (connection) { NMSettingConnection *s_con; - const char *slave_type; + const char *port_type; s_con = nm_connection_get_setting_connection(connection); if (!s_con) { @@ -101,16 +101,16 @@ verify(NMSetting *setting, NMConnection *connection, GError **error) return FALSE; } - slave_type = nm_setting_connection_get_port_type(s_con); - if (slave_type && !nm_streq(slave_type, NM_SETTING_BOND_SETTING_NAME)) { + port_type = nm_setting_connection_get_port_type(s_con); + if (port_type && !nm_streq(port_type, NM_SETTING_BOND_SETTING_NAME)) { g_set_error(error, NM_CONNECTION_ERROR, NM_CONNECTION_ERROR_INVALID_PROPERTY, - _("A connection with a '%s' setting must have the slave-type set to '%s'. " + _("A connection with a '%s' setting must have the port-type set to '%s'. " "Instead it is '%s'"), NM_SETTING_BOND_PORT_SETTING_NAME, NM_SETTING_BOND_SETTING_NAME, - slave_type); + port_type); g_prefix_error(error, "%s.%s: ", NM_SETTING_CONNECTION_SETTING_NAME, diff --git a/src/libnm-core-impl/nm-setting-bridge-port.c b/src/libnm-core-impl/nm-setting-bridge-port.c index dcb17896..e5f0e175 100644 --- a/src/libnm-core-impl/nm-setting-bridge-port.c +++ b/src/libnm-core-impl/nm-setting-bridge-port.c @@ -316,7 +316,7 @@ verify(NMSetting *setting, NMConnection *connection, GError **error) if (connection) { NMSettingConnection *s_con; - const char *slave_type; + const char *port_type; s_con = nm_connection_get_setting_connection(connection); if (!s_con) { @@ -328,16 +328,16 @@ verify(NMSetting *setting, NMConnection *connection, GError **error) return FALSE; } - slave_type = nm_setting_connection_get_port_type(s_con); - if (slave_type && strcmp(slave_type, NM_SETTING_BRIDGE_SETTING_NAME)) { + port_type = nm_setting_connection_get_port_type(s_con); + if (port_type && strcmp(port_type, NM_SETTING_BRIDGE_SETTING_NAME)) { g_set_error(error, NM_CONNECTION_ERROR, NM_CONNECTION_ERROR_INVALID_PROPERTY, - _("A connection with a '%s' setting must have the slave-type set to '%s'. " + _("A connection with a '%s' setting must have the port-type set to '%s'. " "Instead it is '%s'"), NM_SETTING_BRIDGE_PORT_SETTING_NAME, NM_SETTING_BRIDGE_SETTING_NAME, - slave_type); + port_type); g_prefix_error(error, "%s.%s: ", NM_SETTING_CONNECTION_SETTING_NAME, diff --git a/src/libnm-core-impl/nm-setting-connection.c b/src/libnm-core-impl/nm-setting-connection.c index 30a9509b..b51cd46b 100644 --- a/src/libnm-core-impl/nm-setting-connection.c +++ b/src/libnm-core-impl/nm-setting-connection.c @@ -712,7 +712,7 @@ nm_setting_connection_get_zone(NMSettingConnection *setting) * * Returns the #NMSettingConnection:master property of the connection. * - * Returns: interface name of the master device or UUID of the master + * Returns: interface name of the controller device or UUID of the controller * connection. * * Deprecated: 1.46. Use nm_setting_connection_get_master() instead which @@ -767,7 +767,7 @@ nm_setting_connection_get_port_type(NMSettingConnection *setting) * * Returns the #NMSettingConnection:slave-type property of the connection. * - * Returns: the type of slave this connection is, if any + * Returns: the type of port this connection is, if any * * Deprecated: 1.46. Use nm_setting_connection_get_port_type() instead which * is just an alias. @@ -782,9 +782,9 @@ nm_setting_connection_get_slave_type(NMSettingConnection *setting) * nm_setting_connection_is_slave_type: * @setting: the #NMSettingConnection * @type: the setting name (ie #NM_SETTING_BOND_SETTING_NAME) to be matched - * against @setting's slave type + * against @setting's port type * - * Returns: %TRUE if connection is of the given slave @type + * Returns: %TRUE if connection is of the given port @type * * Deprecated: 1.46. */ @@ -875,7 +875,7 @@ nm_setting_connection_get_autoconnect_ports(NMSettingConnection *setting) * * Returns the #NMSettingConnection:autoconnect-slaves property of the connection. * - * Returns: whether slaves of the connection should be activated together + * Returns: whether ports of the connection should be activated together * with the connection. * * Since: 1.2 @@ -1149,33 +1149,33 @@ _set_error_missing_base_setting(GError **error, const char *type) } gboolean -_nm_connection_detect_slave_type_full(NMSettingConnection *s_con, - NMConnection *connection, - const char **out_slave_type, - const char **out_normerr_slave_setting_type, - const char **out_normerr_missing_slave_type, - const char **out_normerr_missing_slave_type_port, - GError **error) +_nm_connection_detect_port_type_full(NMSettingConnection *s_con, + NMConnection *connection, + const char **out_port_type, + const char **out_normerr_port_setting_type, + const char **out_normerr_missing_port_type, + const char **out_normerr_missing_port_type_port, + GError **error) { NMSettingConnectionPrivate *priv = NM_SETTING_CONNECTION_GET_PRIVATE(s_con); - gboolean is_slave; - const char *slave_setting_type; - const char *slave_type; - const char *normerr_slave_setting_type = NULL; - const char *normerr_missing_slave_type = NULL; - const char *normerr_missing_slave_type_port = NULL; - - is_slave = FALSE; - slave_setting_type = NULL; - slave_type = priv->port_type; - if (slave_type) { - is_slave = _nm_setting_slave_type_is_valid(slave_type, &slave_setting_type); - if (!is_slave) { + gboolean is_port; + const char *port_setting_type; + const char *port_type; + const char *normerr_port_setting_type = NULL; + const char *normerr_missing_port_type = NULL; + const char *normerr_missing_port_type_port = NULL; + + is_port = FALSE; + port_setting_type = NULL; + port_type = priv->port_type; + if (port_type) { + is_port = _nm_setting_port_type_is_valid(port_type, &port_setting_type); + if (!is_port) { g_set_error(error, NM_CONNECTION_ERROR, NM_CONNECTION_ERROR_INVALID_PROPERTY, - _("Unknown slave type '%s'"), - slave_type); + _("Unknown port type '%s'"), + port_type); g_prefix_error(error, "%s.%s: ", NM_SETTING_CONNECTION_SETTING_NAME, @@ -1184,7 +1184,7 @@ _nm_connection_detect_slave_type_full(NMSettingConnection *s_con, } } - if (is_slave) { + if (is_port) { if (!priv->controller) { g_set_error(error, NM_CONNECTION_ERROR, @@ -1197,18 +1197,17 @@ _nm_connection_detect_slave_type_full(NMSettingConnection *s_con, NM_SETTING_CONNECTION_CONTROLLER); return FALSE; } - if (slave_setting_type && connection - && !nm_connection_get_setting_by_name(connection, slave_setting_type)) - normerr_slave_setting_type = slave_setting_type; + if (port_setting_type && connection + && !nm_connection_get_setting_by_name(connection, port_setting_type)) + normerr_port_setting_type = port_setting_type; } else { - nm_assert(!slave_type); + nm_assert(!port_type); if (priv->controller) { NMSetting *s_port; - if (connection - && (slave_type = _nm_connection_detect_slave_type(connection, &s_port))) { - normerr_missing_slave_type = slave_type; - normerr_missing_slave_type_port = nm_setting_get_name(s_port); + if (connection && (port_type = _nm_connection_detect_port_type(connection, &s_port))) { + normerr_missing_port_type = port_type; + normerr_missing_port_type_port = nm_setting_get_name(s_port); } else { g_set_error(error, NM_CONNECTION_ERROR, @@ -1225,10 +1224,10 @@ _nm_connection_detect_slave_type_full(NMSettingConnection *s_con, } } - NM_SET_OUT(out_slave_type, slave_type); - NM_SET_OUT(out_normerr_slave_setting_type, normerr_slave_setting_type); - NM_SET_OUT(out_normerr_missing_slave_type, normerr_missing_slave_type); - NM_SET_OUT(out_normerr_missing_slave_type_port, normerr_missing_slave_type_port); + NM_SET_OUT(out_port_type, port_type); + NM_SET_OUT(out_normerr_port_setting_type, normerr_port_setting_type); + NM_SET_OUT(out_normerr_missing_port_type, normerr_missing_port_type); + NM_SET_OUT(out_normerr_missing_port_type_port, normerr_missing_port_type_port); return TRUE; } @@ -1239,12 +1238,12 @@ verify(NMSetting *setting, NMConnection *connection, GError **error) NMSettingConnectionPrivate *priv = NM_SETTING_CONNECTION_GET_PRIVATE(self); NMSetting *normerr_base_type = NULL; const char *type; - const char *slave_type; - const char *normerr_slave_setting_type = NULL; - const char *normerr_missing_slave_type = NULL; - const char *normerr_missing_slave_type_port = NULL; - gboolean normerr_base_setting = FALSE; - gboolean uuid_was_normalized = FALSE; + const char *port_type; + const char *normerr_port_setting_type = NULL; + const char *normerr_missing_port_type = NULL; + const char *normerr_missing_port_type_port = NULL; + gboolean normerr_base_setting = FALSE; + gboolean uuid_was_normalized = FALSE; if (!priv->id) { g_set_error_literal(error, @@ -1409,24 +1408,24 @@ verify(NMSetting *setting, NMConnection *connection, GError **error) } after_interface_name: - if (!_nm_connection_detect_slave_type_full(self, - connection, - &slave_type, - &normerr_slave_setting_type, - &normerr_missing_slave_type, - &normerr_missing_slave_type_port, - error)) + if (!_nm_connection_detect_port_type_full(self, + connection, + &port_type, + &normerr_port_setting_type, + &normerr_missing_port_type, + &normerr_missing_port_type_port, + error)) return FALSE; - if (nm_streq(type, NM_SETTING_OVS_PORT_SETTING_NAME) && slave_type - && !nm_streq(slave_type, NM_SETTING_OVS_BRIDGE_SETTING_NAME)) { + if (nm_streq(type, NM_SETTING_OVS_PORT_SETTING_NAME) && port_type + && !nm_streq(port_type, NM_SETTING_OVS_BRIDGE_SETTING_NAME)) { g_set_error(error, NM_CONNECTION_ERROR, NM_CONNECTION_ERROR_MISSING_PROPERTY, - _("'%s' connections must be enslaved to '%s', not '%s'"), + _("'%s' connections must be attached as port to '%s', not '%s'"), NM_SETTING_OVS_PORT_SETTING_NAME, NM_SETTING_OVS_BRIDGE_SETTING_NAME, - slave_type); + port_type); g_prefix_error(error, "%s.%s: ", NM_SETTING_CONNECTION_SETTING_NAME, @@ -1643,27 +1642,27 @@ after_interface_name: return NM_SETTING_VERIFY_NORMALIZABLE_ERROR; } - if (normerr_slave_setting_type) { + if (normerr_port_setting_type) { g_set_error(error, NM_CONNECTION_ERROR, NM_CONNECTION_ERROR_MISSING_SETTING, _("port-type '%s' requires a '%s' setting in the connection"), priv->port_type, - normerr_slave_setting_type); - g_prefix_error(error, "%s: ", normerr_slave_setting_type); + normerr_port_setting_type); + g_prefix_error(error, "%s: ", normerr_port_setting_type); return NM_SETTING_VERIFY_NORMALIZABLE_ERROR; } - if (normerr_missing_slave_type) { + if (normerr_missing_port_type) { g_set_error(error, NM_CONNECTION_ERROR, NM_CONNECTION_ERROR_MISSING_PROPERTY, - _("Detect a slave connection with '%s' set and a port type '%s'. '%s' should " + _("Detect a port connection with '%s' set and a port type '%s'. '%s' should " "be set to '%s'"), NM_SETTING_CONNECTION_CONTROLLER, - normerr_missing_slave_type_port, + normerr_missing_port_type_port, NM_SETTING_CONNECTION_PORT_TYPE, - normerr_missing_slave_type); + normerr_missing_port_type); g_prefix_error(error, "%s.%s: ", NM_SETTING_CONNECTION_SETTING_NAME, @@ -1684,7 +1683,7 @@ after_interface_name: g_set_error(error, NM_CONNECTION_ERROR, NM_CONNECTION_ERROR_INVALID_SETTING, - _("A slave connection with '%s' set to '%s' cannot have a '%s' setting"), + _("A port connection with '%s' set to '%s' cannot have a '%s' setting"), NM_SETTING_CONNECTION_PORT_TYPE, priv->port_type ?: "", has_bridge_port ? NM_SETTING_BRIDGE_PORT_SETTING_NAME @@ -2531,14 +2530,14 @@ nm_setting_connection_class_init(NMSettingConnectionClass *klass) /** * NMSettingConnection:master: * - * Interface name of the master device or UUID of the master connection. + * Interface name of the controller device or UUID of the controller connection. * * Deprecated 1.46. Use #NMSettingConnection:controller instead, this is just an alias. **/ /* ---ifcfg-rh--- * property: master * variable: MASTER, MASTER_UUID, TEAM_MASTER, TEAM_MASTER_UUID, BRIDGE, BRIDGE_UUID - * description: Reference to master connection. The variable used depends on + * description: Reference to controller connection. The variable used depends on * the connection type and the value. In general, if the *_UUID variant is present, * the variant without *_UUID is ignored. NetworkManager attempts to write both * for compatibility with legacy tooling. @@ -2589,9 +2588,9 @@ nm_setting_connection_class_init(NMSettingConnectionClass *klass) /** * NMSettingConnection:slave-type: * - * Setting name of the device type of this slave's master connection (eg, + * Setting name of the device type of this port's controller connection (eg, * %NM_SETTING_BOND_SETTING_NAME), or %NULL if this connection is not a - * slave. + * port. * * Deprecated 1.46. Use #NMSettingConnection:port-type instead, this is just an alias. **/ @@ -2655,13 +2654,13 @@ nm_setting_connection_class_init(NMSettingConnectionClass *klass) /** * NMSettingConnection:autoconnect-slaves: * - * Whether or not slaves of this connection should be automatically brought up + * Whether or not ports of this connection should be automatically brought up * when NetworkManager activates this connection. This only has a real effect - * for master connections. The properties #NMSettingConnection:autoconnect, + * for controller connections. The properties #NMSettingConnection:autoconnect, * #NMSettingConnection:autoconnect-priority and #NMSettingConnection:autoconnect-retries * are unrelated to this setting. - * The permitted values are: 0: leave slave connections untouched, - * 1: activate all the slave connections with this connection, -1: default. + * The permitted values are: 0: leave port connections untouched, + * 1: activate all the port connections with this connection, -1: default. * If -1 (default) is set, global connection.autoconnect-slaves is read to * determine the real value. If it is default as well, this fallbacks to 0. * diff --git a/src/libnm-core-impl/nm-setting-macsec.c b/src/libnm-core-impl/nm-setting-macsec.c index 5732fa07..74d99c2e 100644 --- a/src/libnm-core-impl/nm-setting-macsec.c +++ b/src/libnm-core-impl/nm-setting-macsec.c @@ -316,24 +316,24 @@ verify(NMSetting *setting, NMConnection *connection, GError **error) if (priv->parent) { if (nm_utils_is_uuid(priv->parent)) { - /* If we have an NMSettingConnection:master with slave-type="macsec", + /* If we have an NMSettingConnection:controller with port-type="macsec", * then it must be the same UUID. */ if (s_con) { - const char *master = NULL, *slave_type = NULL; + const char *controller = NULL, *port_type = NULL; - slave_type = nm_setting_connection_get_port_type(s_con); - if (!g_strcmp0(slave_type, NM_SETTING_MACSEC_SETTING_NAME)) - master = nm_setting_connection_get_controller(s_con); + port_type = nm_setting_connection_get_port_type(s_con); + if (!g_strcmp0(port_type, NM_SETTING_MACSEC_SETTING_NAME)) + controller = nm_setting_connection_get_controller(s_con); - if (master && g_strcmp0(priv->parent, master) != 0) { + if (controller && g_strcmp0(priv->parent, controller) != 0) { g_set_error(error, NM_CONNECTION_ERROR, NM_CONNECTION_ERROR_INVALID_PROPERTY, _("'%s' value doesn't match '%s=%s'"), priv->parent, NM_SETTING_CONNECTION_CONTROLLER, - master); + controller); g_prefix_error(error, "%s.%s: ", NM_SETTING_MACSEC_SETTING_NAME, diff --git a/src/libnm-core-impl/nm-setting-ovs-bridge.c b/src/libnm-core-impl/nm-setting-ovs-bridge.c index 410d8771..bbbb1a46 100644 --- a/src/libnm-core-impl/nm-setting-ovs-bridge.c +++ b/src/libnm-core-impl/nm-setting-ovs-bridge.c @@ -157,7 +157,7 @@ verify(NMSetting *setting, NMConnection *connection, GError **error) g_set_error(error, NM_CONNECTION_ERROR, NM_CONNECTION_ERROR_INVALID_PROPERTY, - _("A connection with a '%s' setting must not have a master."), + _("A connection with a '%s' setting must not have a controller."), NM_SETTING_OVS_BRIDGE_SETTING_NAME); g_prefix_error(error, "%s.%s: ", diff --git a/src/libnm-core-impl/nm-setting-ovs-external-ids.c b/src/libnm-core-impl/nm-setting-ovs-external-ids.c index 0cdf3e6b..9acdae6c 100644 --- a/src/libnm-core-impl/nm-setting-ovs-external-ids.c +++ b/src/libnm-core-impl/nm-setting-ovs-external-ids.c @@ -124,7 +124,7 @@ _nm_setting_ovs_verify_connection_type(GType gtype, NMConnection *connection, GE { NMSettingConnection *s_con; const char *type; - const char *slave_type; + const char *port_type; nm_assert(!connection || NM_IS_CONNECTION(connection)); nm_assert(NM_IN_SET(gtype, NM_TYPE_SETTING_OVS_EXTERNAL_IDS, NM_TYPE_SETTING_OVS_OTHER_CONFIG)); @@ -150,14 +150,14 @@ _nm_setting_ovs_verify_connection_type(GType gtype, NMConnection *connection, GE return TRUE; if ((s_con = nm_connection_get_setting_connection(connection)) - && _nm_connection_detect_slave_type_full(s_con, - connection, - &slave_type, - NULL, - NULL, - NULL, - NULL) - && nm_streq0(slave_type, NM_SETTING_OVS_PORT_SETTING_NAME)) + && _nm_connection_detect_port_type_full(s_con, + connection, + &port_type, + NULL, + NULL, + NULL, + NULL) + && nm_streq0(port_type, NM_SETTING_OVS_PORT_SETTING_NAME)) return TRUE; g_set_error(error, diff --git a/src/libnm-core-impl/nm-setting-ovs-interface.c b/src/libnm-core-impl/nm-setting-ovs-interface.c index 47c73665..22b3bf9e 100644 --- a/src/libnm-core-impl/nm-setting-ovs-interface.c +++ b/src/libnm-core-impl/nm-setting-ovs-interface.c @@ -296,7 +296,7 @@ verify(NMSetting *setting, NMConnection *connection, GError **error) NMSettingConnection *s_con = NULL; if (connection) { - const char *slave_type; + const char *port_type; s_con = nm_connection_get_setting_connection(connection); if (!s_con) { @@ -321,16 +321,16 @@ verify(NMSetting *setting, NMConnection *connection, GError **error) return FALSE; } - slave_type = nm_setting_connection_get_port_type(s_con); - if (slave_type && !nm_streq(slave_type, NM_SETTING_OVS_PORT_SETTING_NAME)) { + port_type = nm_setting_connection_get_port_type(s_con); + if (port_type && !nm_streq(port_type, NM_SETTING_OVS_PORT_SETTING_NAME)) { g_set_error(error, NM_CONNECTION_ERROR, NM_CONNECTION_ERROR_INVALID_PROPERTY, - _("A connection with a '%s' setting must have the slave-type set to '%s'. " + _("A connection with a '%s' setting must have the port-type set to '%s'. " "Instead it is '%s'"), NM_SETTING_OVS_INTERFACE_SETTING_NAME, NM_SETTING_OVS_PORT_SETTING_NAME, - slave_type); + port_type); g_prefix_error(error, "%s.%s: ", NM_SETTING_CONNECTION_SETTING_NAME, diff --git a/src/libnm-core-impl/nm-setting-ovs-port.c b/src/libnm-core-impl/nm-setting-ovs-port.c index 107d76cd..7e5e5e14 100644 --- a/src/libnm-core-impl/nm-setting-ovs-port.c +++ b/src/libnm-core-impl/nm-setting-ovs-port.c @@ -401,7 +401,7 @@ verify(NMSetting *setting, NMConnection *connection, GError **error) if (connection) { NMSettingConnection *s_con; - const char *slave_type; + const char *port_type; s_con = nm_connection_get_setting_connection(connection); if (!s_con) { @@ -417,7 +417,7 @@ verify(NMSetting *setting, NMConnection *connection, GError **error) g_set_error(error, NM_CONNECTION_ERROR, NM_CONNECTION_ERROR_INVALID_PROPERTY, - _("A connection with a '%s' setting must have a master."), + _("A connection with a '%s' setting must have a controller."), NM_SETTING_OVS_PORT_SETTING_NAME); g_prefix_error(error, "%s.%s: ", @@ -426,8 +426,8 @@ verify(NMSetting *setting, NMConnection *connection, GError **error) return FALSE; } - slave_type = nm_setting_connection_get_port_type(s_con); - if (slave_type && strcmp(slave_type, NM_SETTING_OVS_BRIDGE_SETTING_NAME)) { + port_type = nm_setting_connection_get_port_type(s_con); + if (port_type && strcmp(port_type, NM_SETTING_OVS_BRIDGE_SETTING_NAME)) { g_set_error(error, NM_CONNECTION_ERROR, NM_CONNECTION_ERROR_INVALID_PROPERTY, @@ -435,7 +435,7 @@ verify(NMSetting *setting, NMConnection *connection, GError **error) "Instead it is '%s'"), NM_SETTING_OVS_PORT_SETTING_NAME, NM_SETTING_OVS_BRIDGE_SETTING_NAME, - slave_type); + port_type); g_prefix_error(error, "%s.%s: ", NM_SETTING_CONNECTION_SETTING_NAME, diff --git a/src/libnm-core-impl/nm-setting-private.h b/src/libnm-core-impl/nm-setting-private.h index 7d493248..da7fdbb7 100644 --- a/src/libnm-core-impl/nm-setting-private.h +++ b/src/libnm-core-impl/nm-setting-private.h @@ -357,7 +357,7 @@ gboolean _nm_setting_verify_secret_string(const char *str, gboolean _nm_setting_aggregate(NMSetting *setting, NMConnectionAggregateType type, gpointer arg); -gboolean _nm_setting_slave_type_is_valid(const char *slave_type, const char **out_port_type); +gboolean _nm_setting_port_type_is_valid(const char *port_type, const char **out_port_type); gboolean _nm_setting_compare_flags_check(const GParamSpec *param_spec, NMSettingCompareFlags flags, @@ -407,20 +407,20 @@ GVariant *_nm_setting_connection_controller_to_dbus(_NM_SETT_INFO_PROP_TO_DBUS_F gboolean _nm_setting_connection_master_from_dbus(_NM_SETT_INFO_PROP_FROM_DBUS_FCN_ARGS _nm_nil); -gboolean _nm_setting_connection_port_type_from_dbus(_NM_SETT_INFO_PROP_FROM_DBUS_FCN_ARGS _nm_nil); +gboolean _nm_setting_connection_slave_type_from_dbus(_NM_SETT_INFO_PROP_FROM_DBUS_FCN_ARGS _nm_nil); GVariant *_nm_setting_connection_port_type_to_dbus(_NM_SETT_INFO_PROP_TO_DBUS_FCN_ARGS _nm_nil); -gboolean _nm_setting_connection_slave_type_from_dbus(_NM_SETT_INFO_PROP_FROM_DBUS_FCN_ARGS _nm_nil); +gboolean _nm_setting_connection_port_type_from_dbus(_NM_SETT_INFO_PROP_FROM_DBUS_FCN_ARGS _nm_nil); gboolean -_nm_setting_connection_autoconnect_ports_from_dbus(_NM_SETT_INFO_PROP_FROM_DBUS_FCN_ARGS _nm_nil); +_nm_setting_connection_autoconnect_slaves_from_dbus(_NM_SETT_INFO_PROP_FROM_DBUS_FCN_ARGS _nm_nil); GVariant * _nm_setting_connection_autoconnect_ports_to_dbus(_NM_SETT_INFO_PROP_TO_DBUS_FCN_ARGS _nm_nil); gboolean -_nm_setting_connection_autoconnect_slaves_from_dbus(_NM_SETT_INFO_PROP_FROM_DBUS_FCN_ARGS _nm_nil); +_nm_setting_connection_autoconnect_ports_from_dbus(_NM_SETT_INFO_PROP_FROM_DBUS_FCN_ARGS _nm_nil); gboolean _nm_setting_wireless_mac_denylist_from_dbus(_NM_SETT_INFO_PROP_FROM_DBUS_FCN_ARGS _nm_nil); diff --git a/src/libnm-core-impl/nm-setting-team-port.c b/src/libnm-core-impl/nm-setting-team-port.c index a881ec5f..5c04e157 100644 --- a/src/libnm-core-impl/nm-setting-team-port.c +++ b/src/libnm-core-impl/nm-setting-team-port.c @@ -311,7 +311,7 @@ verify(NMSetting *setting, NMConnection *connection, GError **error) if (connection) { NMSettingConnection *s_con; - const char *slave_type; + const char *port_type; s_con = nm_connection_get_setting_connection(connection); if (!s_con) { @@ -323,16 +323,16 @@ verify(NMSetting *setting, NMConnection *connection, GError **error) return FALSE; } - slave_type = nm_setting_connection_get_port_type(s_con); - if (slave_type && strcmp(slave_type, NM_SETTING_TEAM_SETTING_NAME)) { + port_type = nm_setting_connection_get_port_type(s_con); + if (port_type && strcmp(port_type, NM_SETTING_TEAM_SETTING_NAME)) { g_set_error(error, NM_CONNECTION_ERROR, NM_CONNECTION_ERROR_INVALID_PROPERTY, - _("A connection with a '%s' setting must have the slave-type set to '%s'. " + _("A connection with a '%s' setting must have the port-type set to '%s'. " "Instead it is '%s'"), NM_SETTING_TEAM_PORT_SETTING_NAME, NM_SETTING_TEAM_SETTING_NAME, - slave_type); + port_type); g_prefix_error(error, "%s.%s: ", NM_SETTING_CONNECTION_SETTING_NAME, diff --git a/src/libnm-core-impl/nm-setting-team.c b/src/libnm-core-impl/nm-setting-team.c index 08364af8..59fbdcb2 100644 --- a/src/libnm-core-impl/nm-setting-team.c +++ b/src/libnm-core-impl/nm-setting-team.c @@ -592,7 +592,7 @@ nm_team_link_watcher_get_delay_down(const NMTeamLinkWatcher *watcher) * nm_team_link_watcher_get_init_wait: * @watcher: the #NMTeamLinkWatcher * - * Gets the init_wait interval (in milliseconds) that the team slave should + * Gets the init_wait interval (in milliseconds) that the team port should * wait before sending the first packet to the target host. * * Since: 1.12 @@ -613,7 +613,7 @@ nm_team_link_watcher_get_init_wait(const NMTeamLinkWatcher *watcher) * nm_team_link_watcher_get_interval: * @watcher: the #NMTeamLinkWatcher * - * Gets the interval (in milliseconds) that the team slave should wait between + * Gets the interval (in milliseconds) that the team port should wait between * sending two check packets to the target host. * * Since: 1.12 @@ -727,7 +727,7 @@ nm_team_link_watcher_get_flags(const NMTeamLinkWatcher *watcher) /*****************************************************************************/ -static GParamSpec *obj_properties[_NM_TEAM_ATTRIBUTE_MASTER_NUM] = { +static GParamSpec *obj_properties[_NM_TEAM_ATTRIBUTE_CONTROLLER_NUM] = { NULL, }; @@ -804,7 +804,7 @@ nm_setting_team_get_notify_peers_count(NMSettingTeam *setting) { g_return_val_if_fail(NM_IS_SETTING_TEAM(setting), 0); - return NM_SETTING_TEAM_GET_PRIVATE(setting)->team_setting->d.master.notify_peers_count; + return NM_SETTING_TEAM_GET_PRIVATE(setting)->team_setting->d.controller.notify_peers_count; } /** @@ -820,7 +820,7 @@ nm_setting_team_get_notify_peers_interval(NMSettingTeam *setting) { g_return_val_if_fail(NM_IS_SETTING_TEAM(setting), 0); - return NM_SETTING_TEAM_GET_PRIVATE(setting)->team_setting->d.master.notify_peers_interval; + return NM_SETTING_TEAM_GET_PRIVATE(setting)->team_setting->d.controller.notify_peers_interval; } /** @@ -836,7 +836,7 @@ nm_setting_team_get_mcast_rejoin_count(NMSettingTeam *setting) { g_return_val_if_fail(NM_IS_SETTING_TEAM(setting), 0); - return NM_SETTING_TEAM_GET_PRIVATE(setting)->team_setting->d.master.mcast_rejoin_count; + return NM_SETTING_TEAM_GET_PRIVATE(setting)->team_setting->d.controller.mcast_rejoin_count; } /** @@ -852,7 +852,7 @@ nm_setting_team_get_mcast_rejoin_interval(NMSettingTeam *setting) { g_return_val_if_fail(NM_IS_SETTING_TEAM(setting), 0); - return NM_SETTING_TEAM_GET_PRIVATE(setting)->team_setting->d.master.mcast_rejoin_interval; + return NM_SETTING_TEAM_GET_PRIVATE(setting)->team_setting->d.controller.mcast_rejoin_interval; } /** @@ -868,7 +868,7 @@ nm_setting_team_get_runner(NMSettingTeam *setting) { g_return_val_if_fail(NM_IS_SETTING_TEAM(setting), NULL); - return NM_SETTING_TEAM_GET_PRIVATE(setting)->team_setting->d.master.runner; + return NM_SETTING_TEAM_GET_PRIVATE(setting)->team_setting->d.controller.runner; } /** @@ -884,7 +884,7 @@ nm_setting_team_get_runner_hwaddr_policy(NMSettingTeam *setting) { g_return_val_if_fail(NM_IS_SETTING_TEAM(setting), NULL); - return NM_SETTING_TEAM_GET_PRIVATE(setting)->team_setting->d.master.runner_hwaddr_policy; + return NM_SETTING_TEAM_GET_PRIVATE(setting)->team_setting->d.controller.runner_hwaddr_policy; } /** @@ -900,7 +900,7 @@ nm_setting_team_get_runner_tx_balancer(NMSettingTeam *setting) { g_return_val_if_fail(NM_IS_SETTING_TEAM(setting), NULL); - return NM_SETTING_TEAM_GET_PRIVATE(setting)->team_setting->d.master.runner_tx_balancer; + return NM_SETTING_TEAM_GET_PRIVATE(setting)->team_setting->d.controller.runner_tx_balancer; } /** @@ -916,7 +916,8 @@ nm_setting_team_get_runner_tx_balancer_interval(NMSettingTeam *setting) { g_return_val_if_fail(NM_IS_SETTING_TEAM(setting), 0); - return NM_SETTING_TEAM_GET_PRIVATE(setting)->team_setting->d.master.runner_tx_balancer_interval; + return NM_SETTING_TEAM_GET_PRIVATE(setting) + ->team_setting->d.controller.runner_tx_balancer_interval; } /** @@ -932,7 +933,7 @@ nm_setting_team_get_runner_active(NMSettingTeam *setting) { g_return_val_if_fail(NM_IS_SETTING_TEAM(setting), FALSE); - return NM_SETTING_TEAM_GET_PRIVATE(setting)->team_setting->d.master.runner_active; + return NM_SETTING_TEAM_GET_PRIVATE(setting)->team_setting->d.controller.runner_active; } /** @@ -948,7 +949,7 @@ nm_setting_team_get_runner_fast_rate(NMSettingTeam *setting) { g_return_val_if_fail(NM_IS_SETTING_TEAM(setting), FALSE); - return NM_SETTING_TEAM_GET_PRIVATE(setting)->team_setting->d.master.runner_fast_rate; + return NM_SETTING_TEAM_GET_PRIVATE(setting)->team_setting->d.controller.runner_fast_rate; } /** @@ -964,7 +965,7 @@ nm_setting_team_get_runner_sys_prio(NMSettingTeam *setting) { g_return_val_if_fail(NM_IS_SETTING_TEAM(setting), 0); - return NM_SETTING_TEAM_GET_PRIVATE(setting)->team_setting->d.master.runner_sys_prio; + return NM_SETTING_TEAM_GET_PRIVATE(setting)->team_setting->d.controller.runner_sys_prio; } /** @@ -980,7 +981,7 @@ nm_setting_team_get_runner_min_ports(NMSettingTeam *setting) { g_return_val_if_fail(NM_IS_SETTING_TEAM(setting), 0); - return NM_SETTING_TEAM_GET_PRIVATE(setting)->team_setting->d.master.runner_min_ports; + return NM_SETTING_TEAM_GET_PRIVATE(setting)->team_setting->d.controller.runner_min_ports; } /** @@ -996,7 +997,8 @@ nm_setting_team_get_runner_agg_select_policy(NMSettingTeam *setting) { g_return_val_if_fail(NM_IS_SETTING_TEAM(setting), NULL); - return NM_SETTING_TEAM_GET_PRIVATE(setting)->team_setting->d.master.runner_agg_select_policy; + return NM_SETTING_TEAM_GET_PRIVATE(setting) + ->team_setting->d.controller.runner_agg_select_policy; } /** @@ -1020,13 +1022,13 @@ nm_setting_team_remove_runner_tx_hash_by_value(NMSettingTeam *setting, const cha g_return_val_if_fail(NM_IS_SETTING_TEAM(setting), FALSE); g_return_val_if_fail(txhash != NULL, FALSE); - arr = priv->team_setting->d.master.runner_tx_hash; + arr = priv->team_setting->d.controller.runner_tx_hash; if (arr) { for (i = 0; i < arr->len; i++) { if (nm_streq(txhash, arr->pdata[i])) { _maybe_changed_with_assert( setting, - nm_team_setting_value_master_runner_tx_hash_remove(priv->team_setting, i)); + nm_team_setting_value_controller_runner_tx_hash_remove(priv->team_setting, i)); return TRUE; } } @@ -1049,7 +1051,7 @@ nm_setting_team_get_num_runner_tx_hash(NMSettingTeam *setting) g_return_val_if_fail(NM_IS_SETTING_TEAM(setting), 0); - arr = NM_SETTING_TEAM_GET_PRIVATE(setting)->team_setting->d.master.runner_tx_hash; + arr = NM_SETTING_TEAM_GET_PRIVATE(setting)->team_setting->d.controller.runner_tx_hash; return arr ? arr->len : 0u; } @@ -1069,7 +1071,7 @@ nm_setting_team_get_runner_tx_hash(NMSettingTeam *setting, guint idx) g_return_val_if_fail(NM_IS_SETTING_TEAM(setting), NULL); - arr = NM_SETTING_TEAM_GET_PRIVATE(setting)->team_setting->d.master.runner_tx_hash; + arr = NM_SETTING_TEAM_GET_PRIVATE(setting)->team_setting->d.controller.runner_tx_hash; g_return_val_if_fail(arr, NULL); g_return_val_if_fail(idx < arr->len, NULL); @@ -1095,12 +1097,12 @@ nm_setting_team_remove_runner_tx_hash(NMSettingTeam *setting, guint idx) priv = NM_SETTING_TEAM_GET_PRIVATE(setting); - g_return_if_fail(priv->team_setting->d.master.runner_tx_hash); - g_return_if_fail(idx < priv->team_setting->d.master.runner_tx_hash->len); + g_return_if_fail(priv->team_setting->d.controller.runner_tx_hash); + g_return_if_fail(idx < priv->team_setting->d.controller.runner_tx_hash->len); _maybe_changed_with_assert( setting, - nm_team_setting_value_master_runner_tx_hash_remove(priv->team_setting, idx)); + nm_team_setting_value_controller_runner_tx_hash_remove(priv->team_setting, idx)); } /** @@ -1122,7 +1124,7 @@ nm_setting_team_add_runner_tx_hash(NMSettingTeam *setting, const char *txhash) g_return_val_if_fail(txhash, FALSE); return _maybe_changed(setting, - nm_team_setting_value_master_runner_tx_hash_add( + nm_team_setting_value_controller_runner_tx_hash_add( NM_SETTING_TEAM_GET_PRIVATE(setting)->team_setting, txhash)); } @@ -1359,27 +1361,27 @@ get_property(GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) case NM_TEAM_ATTRIBUTE_CONFIG: g_value_set_string(value, nm_team_setting_config_get(priv->team_setting)); break; - case NM_TEAM_ATTRIBUTE_MASTER_RUNNER_ACTIVE: - case NM_TEAM_ATTRIBUTE_MASTER_RUNNER_FAST_RATE: + case NM_TEAM_ATTRIBUTE_CONTROLLER_RUNNER_ACTIVE: + case NM_TEAM_ATTRIBUTE_CONTROLLER_RUNNER_FAST_RATE: g_value_set_boolean(value, nm_team_setting_value_get_bool(priv->team_setting, prop_id)); break; - case NM_TEAM_ATTRIBUTE_MASTER_NOTIFY_PEERS_COUNT: - case NM_TEAM_ATTRIBUTE_MASTER_NOTIFY_PEERS_INTERVAL: - case NM_TEAM_ATTRIBUTE_MASTER_MCAST_REJOIN_COUNT: - case NM_TEAM_ATTRIBUTE_MASTER_MCAST_REJOIN_INTERVAL: - case NM_TEAM_ATTRIBUTE_MASTER_RUNNER_TX_BALANCER_INTERVAL: - case NM_TEAM_ATTRIBUTE_MASTER_RUNNER_SYS_PRIO: - case NM_TEAM_ATTRIBUTE_MASTER_RUNNER_MIN_PORTS: + case NM_TEAM_ATTRIBUTE_CONTROLLER_NOTIFY_PEERS_COUNT: + case NM_TEAM_ATTRIBUTE_CONTROLLER_NOTIFY_PEERS_INTERVAL: + case NM_TEAM_ATTRIBUTE_CONTROLLER_MCAST_REJOIN_COUNT: + case NM_TEAM_ATTRIBUTE_CONTROLLER_MCAST_REJOIN_INTERVAL: + case NM_TEAM_ATTRIBUTE_CONTROLLER_RUNNER_TX_BALANCER_INTERVAL: + case NM_TEAM_ATTRIBUTE_CONTROLLER_RUNNER_SYS_PRIO: + case NM_TEAM_ATTRIBUTE_CONTROLLER_RUNNER_MIN_PORTS: g_value_set_int(value, nm_team_setting_value_get_int32(priv->team_setting, prop_id)); break; - case NM_TEAM_ATTRIBUTE_MASTER_RUNNER: - case NM_TEAM_ATTRIBUTE_MASTER_RUNNER_HWADDR_POLICY: - case NM_TEAM_ATTRIBUTE_MASTER_RUNNER_TX_BALANCER: - case NM_TEAM_ATTRIBUTE_MASTER_RUNNER_AGG_SELECT_POLICY: + case NM_TEAM_ATTRIBUTE_CONTROLLER_RUNNER: + case NM_TEAM_ATTRIBUTE_CONTROLLER_RUNNER_HWADDR_POLICY: + case NM_TEAM_ATTRIBUTE_CONTROLLER_RUNNER_TX_BALANCER: + case NM_TEAM_ATTRIBUTE_CONTROLLER_RUNNER_AGG_SELECT_POLICY: g_value_set_string(value, nm_team_setting_value_get_string(priv->team_setting, prop_id)); break; - case NM_TEAM_ATTRIBUTE_MASTER_RUNNER_TX_HASH: - v_ptrarr = priv->team_setting->d.master.runner_tx_hash; + case NM_TEAM_ATTRIBUTE_CONTROLLER_RUNNER_TX_HASH: + v_ptrarr = priv->team_setting->d.controller.runner_tx_hash; g_value_take_boxed(value, nm_strv_ptrarray_to_strv_full(v_ptrarr, FALSE)); break; case NM_TEAM_ATTRIBUTE_LINK_WATCHERS: @@ -1406,32 +1408,32 @@ set_property(GObject *object, guint prop_id, const GValue *value, GParamSpec *ps case NM_TEAM_ATTRIBUTE_CONFIG: changed = nm_team_setting_config_set(priv->team_setting, g_value_get_string(value)); break; - case NM_TEAM_ATTRIBUTE_MASTER_RUNNER_ACTIVE: - case NM_TEAM_ATTRIBUTE_MASTER_RUNNER_FAST_RATE: + case NM_TEAM_ATTRIBUTE_CONTROLLER_RUNNER_ACTIVE: + case NM_TEAM_ATTRIBUTE_CONTROLLER_RUNNER_FAST_RATE: changed = nm_team_setting_value_set_bool(priv->team_setting, prop_id, g_value_get_boolean(value)); break; - case NM_TEAM_ATTRIBUTE_MASTER_NOTIFY_PEERS_COUNT: - case NM_TEAM_ATTRIBUTE_MASTER_NOTIFY_PEERS_INTERVAL: - case NM_TEAM_ATTRIBUTE_MASTER_MCAST_REJOIN_COUNT: - case NM_TEAM_ATTRIBUTE_MASTER_MCAST_REJOIN_INTERVAL: - case NM_TEAM_ATTRIBUTE_MASTER_RUNNER_TX_BALANCER_INTERVAL: - case NM_TEAM_ATTRIBUTE_MASTER_RUNNER_SYS_PRIO: - case NM_TEAM_ATTRIBUTE_MASTER_RUNNER_MIN_PORTS: + case NM_TEAM_ATTRIBUTE_CONTROLLER_NOTIFY_PEERS_COUNT: + case NM_TEAM_ATTRIBUTE_CONTROLLER_NOTIFY_PEERS_INTERVAL: + case NM_TEAM_ATTRIBUTE_CONTROLLER_MCAST_REJOIN_COUNT: + case NM_TEAM_ATTRIBUTE_CONTROLLER_MCAST_REJOIN_INTERVAL: + case NM_TEAM_ATTRIBUTE_CONTROLLER_RUNNER_TX_BALANCER_INTERVAL: + case NM_TEAM_ATTRIBUTE_CONTROLLER_RUNNER_SYS_PRIO: + case NM_TEAM_ATTRIBUTE_CONTROLLER_RUNNER_MIN_PORTS: changed = nm_team_setting_value_set_int32(priv->team_setting, prop_id, g_value_get_int(value)); break; - case NM_TEAM_ATTRIBUTE_MASTER_RUNNER: - case NM_TEAM_ATTRIBUTE_MASTER_RUNNER_TX_BALANCER: - case NM_TEAM_ATTRIBUTE_MASTER_RUNNER_HWADDR_POLICY: - case NM_TEAM_ATTRIBUTE_MASTER_RUNNER_AGG_SELECT_POLICY: + case NM_TEAM_ATTRIBUTE_CONTROLLER_RUNNER: + case NM_TEAM_ATTRIBUTE_CONTROLLER_RUNNER_TX_BALANCER: + case NM_TEAM_ATTRIBUTE_CONTROLLER_RUNNER_HWADDR_POLICY: + case NM_TEAM_ATTRIBUTE_CONTROLLER_RUNNER_AGG_SELECT_POLICY: changed = nm_team_setting_value_set_string(priv->team_setting, prop_id, g_value_get_string(value)); break; - case NM_TEAM_ATTRIBUTE_MASTER_RUNNER_TX_HASH: + case NM_TEAM_ATTRIBUTE_CONTROLLER_RUNNER_TX_HASH: v_ptrarr = g_value_get_boxed(value); - changed = nm_team_setting_value_master_runner_tx_hash_set_list( + changed = nm_team_setting_value_controller_runner_tx_hash_set_list( priv->team_setting, v_ptrarr ? (const char *const *) v_ptrarr->pdata : NULL, v_ptrarr ? v_ptrarr->len : 0u); @@ -1535,7 +1537,7 @@ nm_setting_team_class_init(NMSettingTeamClass *klass) * * Since: 1.12 **/ - obj_properties[NM_TEAM_ATTRIBUTE_MASTER_NOTIFY_PEERS_COUNT] = + obj_properties[NM_TEAM_ATTRIBUTE_CONTROLLER_NOTIFY_PEERS_COUNT] = g_param_spec_int(NM_SETTING_TEAM_NOTIFY_PEERS_COUNT, "", "", @@ -1544,7 +1546,7 @@ nm_setting_team_class_init(NMSettingTeamClass *klass) -1, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); _nm_properties_override_gobj(properties_override, - obj_properties[NM_TEAM_ATTRIBUTE_MASTER_NOTIFY_PEERS_COUNT], + obj_properties[NM_TEAM_ATTRIBUTE_CONTROLLER_NOTIFY_PEERS_COUNT], &nm_sett_info_propert_type_team_i); /** @@ -1554,7 +1556,7 @@ nm_setting_team_class_init(NMSettingTeamClass *klass) * * Since: 1.12 **/ - obj_properties[NM_TEAM_ATTRIBUTE_MASTER_NOTIFY_PEERS_INTERVAL] = + obj_properties[NM_TEAM_ATTRIBUTE_CONTROLLER_NOTIFY_PEERS_INTERVAL] = g_param_spec_int(NM_SETTING_TEAM_NOTIFY_PEERS_INTERVAL, "", "", @@ -1563,7 +1565,7 @@ nm_setting_team_class_init(NMSettingTeamClass *klass) -1, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); _nm_properties_override_gobj(properties_override, - obj_properties[NM_TEAM_ATTRIBUTE_MASTER_NOTIFY_PEERS_INTERVAL], + obj_properties[NM_TEAM_ATTRIBUTE_CONTROLLER_NOTIFY_PEERS_INTERVAL], &nm_sett_info_propert_type_team_i); /** @@ -1573,7 +1575,7 @@ nm_setting_team_class_init(NMSettingTeamClass *klass) * * Since: 1.12 **/ - obj_properties[NM_TEAM_ATTRIBUTE_MASTER_MCAST_REJOIN_COUNT] = + obj_properties[NM_TEAM_ATTRIBUTE_CONTROLLER_MCAST_REJOIN_COUNT] = g_param_spec_int(NM_SETTING_TEAM_MCAST_REJOIN_COUNT, "", "", @@ -1582,7 +1584,7 @@ nm_setting_team_class_init(NMSettingTeamClass *klass) -1, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); _nm_properties_override_gobj(properties_override, - obj_properties[NM_TEAM_ATTRIBUTE_MASTER_MCAST_REJOIN_COUNT], + obj_properties[NM_TEAM_ATTRIBUTE_CONTROLLER_MCAST_REJOIN_COUNT], &nm_sett_info_propert_type_team_i); /** @@ -1592,7 +1594,7 @@ nm_setting_team_class_init(NMSettingTeamClass *klass) * * Since: 1.12 **/ - obj_properties[NM_TEAM_ATTRIBUTE_MASTER_MCAST_REJOIN_INTERVAL] = + obj_properties[NM_TEAM_ATTRIBUTE_CONTROLLER_MCAST_REJOIN_INTERVAL] = g_param_spec_int(NM_SETTING_TEAM_MCAST_REJOIN_INTERVAL, "", "", @@ -1601,7 +1603,7 @@ nm_setting_team_class_init(NMSettingTeamClass *klass) -1, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); _nm_properties_override_gobj(properties_override, - obj_properties[NM_TEAM_ATTRIBUTE_MASTER_MCAST_REJOIN_INTERVAL], + obj_properties[NM_TEAM_ATTRIBUTE_CONTROLLER_MCAST_REJOIN_INTERVAL], &nm_sett_info_propert_type_team_i); /** @@ -1613,14 +1615,14 @@ nm_setting_team_class_init(NMSettingTeamClass *klass) * * Since: 1.12 **/ - obj_properties[NM_TEAM_ATTRIBUTE_MASTER_RUNNER] = + obj_properties[NM_TEAM_ATTRIBUTE_CONTROLLER_RUNNER] = g_param_spec_string(NM_SETTING_TEAM_RUNNER, "", "", NULL, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); _nm_properties_override_gobj(properties_override, - obj_properties[NM_TEAM_ATTRIBUTE_MASTER_RUNNER], + obj_properties[NM_TEAM_ATTRIBUTE_CONTROLLER_RUNNER], &nm_sett_info_propert_type_team_s); /** @@ -1630,14 +1632,14 @@ nm_setting_team_class_init(NMSettingTeamClass *klass) * * Since: 1.12 **/ - obj_properties[NM_TEAM_ATTRIBUTE_MASTER_RUNNER_HWADDR_POLICY] = + obj_properties[NM_TEAM_ATTRIBUTE_CONTROLLER_RUNNER_HWADDR_POLICY] = g_param_spec_string(NM_SETTING_TEAM_RUNNER_HWADDR_POLICY, "", "", NULL, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); _nm_properties_override_gobj(properties_override, - obj_properties[NM_TEAM_ATTRIBUTE_MASTER_RUNNER_HWADDR_POLICY], + obj_properties[NM_TEAM_ATTRIBUTE_CONTROLLER_RUNNER_HWADDR_POLICY], &nm_sett_info_propert_type_team_s); /** @@ -1647,14 +1649,14 @@ nm_setting_team_class_init(NMSettingTeamClass *klass) * * Since: 1.12 **/ - obj_properties[NM_TEAM_ATTRIBUTE_MASTER_RUNNER_TX_HASH] = g_param_spec_boxed( + obj_properties[NM_TEAM_ATTRIBUTE_CONTROLLER_RUNNER_TX_HASH] = g_param_spec_boxed( NM_SETTING_TEAM_RUNNER_TX_HASH, "", "", G_TYPE_STRV, G_PARAM_READWRITE | NM_SETTING_PARAM_INFERRABLE | G_PARAM_STATIC_STRINGS); _nm_properties_override_gobj(properties_override, - obj_properties[NM_TEAM_ATTRIBUTE_MASTER_RUNNER_TX_HASH], + obj_properties[NM_TEAM_ATTRIBUTE_CONTROLLER_RUNNER_TX_HASH], &nm_sett_info_propert_type_team_as); /** @@ -1664,14 +1666,14 @@ nm_setting_team_class_init(NMSettingTeamClass *klass) * * Since: 1.12 **/ - obj_properties[NM_TEAM_ATTRIBUTE_MASTER_RUNNER_TX_BALANCER] = + obj_properties[NM_TEAM_ATTRIBUTE_CONTROLLER_RUNNER_TX_BALANCER] = g_param_spec_string(NM_SETTING_TEAM_RUNNER_TX_BALANCER, "", "", NULL, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); _nm_properties_override_gobj(properties_override, - obj_properties[NM_TEAM_ATTRIBUTE_MASTER_RUNNER_TX_BALANCER], + obj_properties[NM_TEAM_ATTRIBUTE_CONTROLLER_RUNNER_TX_BALANCER], &nm_sett_info_propert_type_team_s); /** @@ -1681,7 +1683,7 @@ nm_setting_team_class_init(NMSettingTeamClass *klass) * * Since: 1.12 **/ - obj_properties[NM_TEAM_ATTRIBUTE_MASTER_RUNNER_TX_BALANCER_INTERVAL] = + obj_properties[NM_TEAM_ATTRIBUTE_CONTROLLER_RUNNER_TX_BALANCER_INTERVAL] = g_param_spec_int(NM_SETTING_TEAM_RUNNER_TX_BALANCER_INTERVAL, "", "", @@ -1691,7 +1693,7 @@ nm_setting_team_class_init(NMSettingTeamClass *klass) G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); _nm_properties_override_gobj( properties_override, - obj_properties[NM_TEAM_ATTRIBUTE_MASTER_RUNNER_TX_BALANCER_INTERVAL], + obj_properties[NM_TEAM_ATTRIBUTE_CONTROLLER_RUNNER_TX_BALANCER_INTERVAL], &nm_sett_info_propert_type_team_i); /** @@ -1701,14 +1703,14 @@ nm_setting_team_class_init(NMSettingTeamClass *klass) * * Since: 1.12 **/ - obj_properties[NM_TEAM_ATTRIBUTE_MASTER_RUNNER_ACTIVE] = + obj_properties[NM_TEAM_ATTRIBUTE_CONTROLLER_RUNNER_ACTIVE] = g_param_spec_boolean(NM_SETTING_TEAM_RUNNER_ACTIVE, "", "", TRUE, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); _nm_properties_override_gobj(properties_override, - obj_properties[NM_TEAM_ATTRIBUTE_MASTER_RUNNER_ACTIVE], + obj_properties[NM_TEAM_ATTRIBUTE_CONTROLLER_RUNNER_ACTIVE], &nm_sett_info_propert_type_team_b); /** @@ -1718,14 +1720,14 @@ nm_setting_team_class_init(NMSettingTeamClass *klass) * * Since: 1.12 **/ - obj_properties[NM_TEAM_ATTRIBUTE_MASTER_RUNNER_FAST_RATE] = + obj_properties[NM_TEAM_ATTRIBUTE_CONTROLLER_RUNNER_FAST_RATE] = g_param_spec_boolean(NM_SETTING_TEAM_RUNNER_FAST_RATE, "", "", FALSE, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); _nm_properties_override_gobj(properties_override, - obj_properties[NM_TEAM_ATTRIBUTE_MASTER_RUNNER_FAST_RATE], + obj_properties[NM_TEAM_ATTRIBUTE_CONTROLLER_RUNNER_FAST_RATE], &nm_sett_info_propert_type_team_b); /** @@ -1735,7 +1737,7 @@ nm_setting_team_class_init(NMSettingTeamClass *klass) * * Since: 1.12 **/ - obj_properties[NM_TEAM_ATTRIBUTE_MASTER_RUNNER_SYS_PRIO] = + obj_properties[NM_TEAM_ATTRIBUTE_CONTROLLER_RUNNER_SYS_PRIO] = g_param_spec_int(NM_SETTING_TEAM_RUNNER_SYS_PRIO, "", "", @@ -1744,7 +1746,7 @@ nm_setting_team_class_init(NMSettingTeamClass *klass) -1, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); _nm_properties_override_gobj(properties_override, - obj_properties[NM_TEAM_ATTRIBUTE_MASTER_RUNNER_SYS_PRIO], + obj_properties[NM_TEAM_ATTRIBUTE_CONTROLLER_RUNNER_SYS_PRIO], &nm_sett_info_propert_type_team_i); /** @@ -1754,7 +1756,7 @@ nm_setting_team_class_init(NMSettingTeamClass *klass) * * Since: 1.12 **/ - obj_properties[NM_TEAM_ATTRIBUTE_MASTER_RUNNER_MIN_PORTS] = + obj_properties[NM_TEAM_ATTRIBUTE_CONTROLLER_RUNNER_MIN_PORTS] = g_param_spec_int(NM_SETTING_TEAM_RUNNER_MIN_PORTS, "", "", @@ -1763,7 +1765,7 @@ nm_setting_team_class_init(NMSettingTeamClass *klass) -1, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); _nm_properties_override_gobj(properties_override, - obj_properties[NM_TEAM_ATTRIBUTE_MASTER_RUNNER_MIN_PORTS], + obj_properties[NM_TEAM_ATTRIBUTE_CONTROLLER_RUNNER_MIN_PORTS], &nm_sett_info_propert_type_team_i); /** @@ -1773,15 +1775,16 @@ nm_setting_team_class_init(NMSettingTeamClass *klass) * * Since: 1.12 **/ - obj_properties[NM_TEAM_ATTRIBUTE_MASTER_RUNNER_AGG_SELECT_POLICY] = + obj_properties[NM_TEAM_ATTRIBUTE_CONTROLLER_RUNNER_AGG_SELECT_POLICY] = g_param_spec_string(NM_SETTING_TEAM_RUNNER_AGG_SELECT_POLICY, "", "", NULL, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); - _nm_properties_override_gobj(properties_override, - obj_properties[NM_TEAM_ATTRIBUTE_MASTER_RUNNER_AGG_SELECT_POLICY], - &nm_sett_info_propert_type_team_s); + _nm_properties_override_gobj( + properties_override, + obj_properties[NM_TEAM_ATTRIBUTE_CONTROLLER_RUNNER_AGG_SELECT_POLICY], + &nm_sett_info_propert_type_team_s); /** * NMSettingTeam:link-watchers: (type GPtrArray(NMTeamLinkWatcher)) diff --git a/src/libnm-core-impl/nm-setting-vlan.c b/src/libnm-core-impl/nm-setting-vlan.c index 16e3cf2a..3a1f0930 100644 --- a/src/libnm-core-impl/nm-setting-vlan.c +++ b/src/libnm-core-impl/nm-setting-vlan.c @@ -608,24 +608,24 @@ verify(NMSetting *setting, NMConnection *connection, GError **error) if (priv->parent) { if (nm_utils_is_uuid(priv->parent)) { - /* If we have an NMSettingConnection:master with slave-type="vlan", + /* If we have an NMSettingConnection:controller with port-type="vlan", * then it must be the same UUID. */ if (s_con) { - const char *master = NULL, *slave_type = NULL; + const char *controller = NULL, *port_type = NULL; - slave_type = nm_setting_connection_get_port_type(s_con); - if (!g_strcmp0(slave_type, NM_SETTING_VLAN_SETTING_NAME)) - master = nm_setting_connection_get_controller(s_con); + port_type = nm_setting_connection_get_port_type(s_con); + if (!g_strcmp0(port_type, NM_SETTING_VLAN_SETTING_NAME)) + controller = nm_setting_connection_get_controller(s_con); - if (master && g_strcmp0(priv->parent, master) != 0) { + if (controller && g_strcmp0(priv->parent, controller) != 0) { g_set_error(error, NM_CONNECTION_ERROR, NM_CONNECTION_ERROR_INVALID_PROPERTY, _("'%s' value doesn't match '%s=%s'"), priv->parent, NM_SETTING_CONNECTION_CONTROLLER, - master); + controller); g_prefix_error(error, "%s.%s: ", NM_SETTING_VLAN_SETTING_NAME, @@ -908,7 +908,7 @@ nm_setting_vlan_class_init(NMSettingVlanClass *klass) * interface. Flags include %NM_VLAN_FLAG_REORDER_HEADERS (reordering of * output packet headers), %NM_VLAN_FLAG_GVRP (use of the GVRP protocol), * and %NM_VLAN_FLAG_LOOSE_BINDING (loose binding of the interface to its - * master device's operating state). %NM_VLAN_FLAG_MVRP (use of the MVRP + * controller device's operating state). %NM_VLAN_FLAG_MVRP (use of the MVRP * protocol). * * The default value of this property is NM_VLAN_FLAG_REORDER_HEADERS, diff --git a/src/libnm-core-impl/nm-setting.c b/src/libnm-core-impl/nm-setting.c index a97edc2a..ed34db76 100644 --- a/src/libnm-core-impl/nm-setting.c +++ b/src/libnm-core-impl/nm-setting.c @@ -138,22 +138,24 @@ _nm_setting_compare_priority(gconstpointer a, gconstpointer b) /*****************************************************************************/ gboolean -_nm_setting_slave_type_is_valid(const char *slave_type, const char **out_port_type) +_nm_setting_port_type_is_valid(const char *port_setting_type, const char **out_port_type) { const char *port_type = NULL; gboolean found = TRUE; - if (!slave_type) + if (!port_setting_type) found = FALSE; - else if (NM_IN_STRSET(slave_type, NM_SETTING_BOND_SETTING_NAME, NM_SETTING_VRF_SETTING_NAME)) { + else if (NM_IN_STRSET(port_setting_type, + NM_SETTING_BOND_SETTING_NAME, + NM_SETTING_VRF_SETTING_NAME)) { /* pass */ - } else if (nm_streq(slave_type, NM_SETTING_BRIDGE_SETTING_NAME)) + } else if (nm_streq(port_setting_type, NM_SETTING_BRIDGE_SETTING_NAME)) port_type = NM_SETTING_BRIDGE_PORT_SETTING_NAME; - else if (nm_streq(slave_type, NM_SETTING_OVS_BRIDGE_SETTING_NAME)) + else if (nm_streq(port_setting_type, NM_SETTING_OVS_BRIDGE_SETTING_NAME)) port_type = NM_SETTING_OVS_PORT_SETTING_NAME; - else if (nm_streq(slave_type, NM_SETTING_OVS_PORT_SETTING_NAME)) + else if (nm_streq(port_setting_type, NM_SETTING_OVS_PORT_SETTING_NAME)) port_type = NM_SETTING_OVS_INTERFACE_SETTING_NAME; - else if (nm_streq(slave_type, NM_SETTING_TEAM_SETTING_NAME)) + else if (nm_streq(port_setting_type, NM_SETTING_TEAM_SETTING_NAME)) port_type = NM_SETTING_TEAM_PORT_SETTING_NAME; else found = FALSE; diff --git a/src/libnm-core-impl/nm-team-utils.c b/src/libnm-core-impl/nm-team-utils.c index 83452569..bad78dee 100644 --- a/src/libnm-core-impl/nm-team-utils.c +++ b/src/libnm-core-impl/nm-team-utils.c @@ -94,39 +94,39 @@ typedef struct { static const RunnerCompatElem _runner_compat_lst[] = { { - NM_TEAM_ATTRIBUTE_MASTER_RUNNER_HWADDR_POLICY, + NM_TEAM_ATTRIBUTE_CONTROLLER_RUNNER_HWADDR_POLICY, NM_MAKE_STRV(NM_SETTING_TEAM_RUNNER_ACTIVEBACKUP), }, { - NM_TEAM_ATTRIBUTE_MASTER_RUNNER_TX_HASH, + NM_TEAM_ATTRIBUTE_CONTROLLER_RUNNER_TX_HASH, NM_MAKE_STRV(NM_SETTING_TEAM_RUNNER_LOADBALANCE, NM_SETTING_TEAM_RUNNER_LACP), }, { - NM_TEAM_ATTRIBUTE_MASTER_RUNNER_TX_BALANCER, + NM_TEAM_ATTRIBUTE_CONTROLLER_RUNNER_TX_BALANCER, NM_MAKE_STRV(NM_SETTING_TEAM_RUNNER_LOADBALANCE, NM_SETTING_TEAM_RUNNER_LACP), }, { - NM_TEAM_ATTRIBUTE_MASTER_RUNNER_TX_BALANCER_INTERVAL, + NM_TEAM_ATTRIBUTE_CONTROLLER_RUNNER_TX_BALANCER_INTERVAL, NM_MAKE_STRV(NM_SETTING_TEAM_RUNNER_LOADBALANCE, NM_SETTING_TEAM_RUNNER_LACP), }, { - NM_TEAM_ATTRIBUTE_MASTER_RUNNER_ACTIVE, + NM_TEAM_ATTRIBUTE_CONTROLLER_RUNNER_ACTIVE, NM_MAKE_STRV(NM_SETTING_TEAM_RUNNER_LACP), }, { - NM_TEAM_ATTRIBUTE_MASTER_RUNNER_FAST_RATE, + NM_TEAM_ATTRIBUTE_CONTROLLER_RUNNER_FAST_RATE, NM_MAKE_STRV(NM_SETTING_TEAM_RUNNER_LACP), }, { - NM_TEAM_ATTRIBUTE_MASTER_RUNNER_SYS_PRIO, + NM_TEAM_ATTRIBUTE_CONTROLLER_RUNNER_SYS_PRIO, NM_MAKE_STRV(NM_SETTING_TEAM_RUNNER_LACP), }, { - NM_TEAM_ATTRIBUTE_MASTER_RUNNER_MIN_PORTS, + NM_TEAM_ATTRIBUTE_CONTROLLER_RUNNER_MIN_PORTS, NM_MAKE_STRV(NM_SETTING_TEAM_RUNNER_LACP), }, { - NM_TEAM_ATTRIBUTE_MASTER_RUNNER_AGG_SELECT_POLICY, + NM_TEAM_ATTRIBUTE_CONTROLLER_RUNNER_AGG_SELECT_POLICY, NM_MAKE_STRV(NM_SETTING_TEAM_RUNNER_LACP), }, }; @@ -148,16 +148,16 @@ typedef struct { NMValueType value_type; guint8 field_offset; guint8 js_keys_len; - bool for_master : 1; + bool for_controller : 1; bool for_port : 1; bool has_range : 1; } TeamAttrData; -#define TEAM_ATTR_IDX(_is_port, _team_attr) \ - (((!(_is_port) || (_team_attr) < _NM_TEAM_ATTRIBUTE_START) \ - ? (int) (_team_attr) \ - : (((int) (_NM_TEAM_ATTRIBUTE_MASTER_NUM - _NM_TEAM_ATTRIBUTE_START)) \ - + ((int) (_team_attr)))) \ +#define TEAM_ATTR_IDX(_is_port, _team_attr) \ + (((!(_is_port) || (_team_attr) < _NM_TEAM_ATTRIBUTE_START) \ + ? (int) (_team_attr) \ + : (((int) (_NM_TEAM_ATTRIBUTE_CONTROLLER_NUM - _NM_TEAM_ATTRIBUTE_START)) \ + + ((int) (_team_attr)))) \ - 1) #define TEAM_ATTR_IDX_CONFIG (TEAM_ATTR_IDX(FALSE, NM_TEAM_ATTRIBUTE_CONFIG)) @@ -187,15 +187,15 @@ static const TeamAttrData team_attr_datas[] = { #define _VAL_UNSPEC() .default_val.v_string = (NULL) -#define _INIT(_is_port, _team_attr, field, _value_type, _property_name, ...) \ - [TEAM_ATTR_IDX(_is_port, _team_attr)] = { \ - .for_master = (_team_attr) < _NM_TEAM_ATTRIBUTE_START || !(_is_port), \ - .for_port = (_team_attr) < _NM_TEAM_ATTRIBUTE_START || (_is_port), \ - .team_attr = (_team_attr), \ - .field_offset = G_STRUCT_OFFSET(NMTeamSetting, _data_priv.field), \ - .value_type = (_value_type), \ - .property_name = ""_property_name \ - "", \ +#define _INIT(_is_port, _team_attr, field, _value_type, _property_name, ...) \ + [TEAM_ATTR_IDX(_is_port, _team_attr)] = { \ + .for_controller = (_team_attr) < _NM_TEAM_ATTRIBUTE_START || !(_is_port), \ + .for_port = (_team_attr) < _NM_TEAM_ATTRIBUTE_START || (_is_port), \ + .team_attr = (_team_attr), \ + .field_offset = G_STRUCT_OFFSET(NMTeamSetting, _data_priv.field), \ + .value_type = (_value_type), \ + .property_name = ""_property_name \ + "", \ __VA_ARGS__} _INIT(0, NM_TEAM_ATTRIBUTE_CONFIG, _js_str, NM_VALUE_TYPE_UNSPEC, NM_SETTING_TEAM_CONFIG, ), @@ -209,99 +209,99 @@ static const TeamAttrData team_attr_datas[] = { _VAL_UNSPEC(), ), _INIT(0, - NM_TEAM_ATTRIBUTE_MASTER_NOTIFY_PEERS_COUNT, - master.notify_peers_count, + NM_TEAM_ATTRIBUTE_CONTROLLER_NOTIFY_PEERS_COUNT, + controller.notify_peers_count, NM_VALUE_TYPE_INT32, NM_SETTING_TEAM_NOTIFY_PEERS_COUNT, _JS_KEYS("notify_peers", "count"), _VAL_INT32_RANGE(-1, 0, G_MAXINT32), ), _INIT(0, - NM_TEAM_ATTRIBUTE_MASTER_NOTIFY_PEERS_INTERVAL, - master.notify_peers_interval, + NM_TEAM_ATTRIBUTE_CONTROLLER_NOTIFY_PEERS_INTERVAL, + controller.notify_peers_interval, NM_VALUE_TYPE_INT32, NM_SETTING_TEAM_NOTIFY_PEERS_INTERVAL, _JS_KEYS("notify_peers", "interval"), _VAL_INT32_RANGE(-1, 0, G_MAXINT32), ), _INIT(0, - NM_TEAM_ATTRIBUTE_MASTER_MCAST_REJOIN_COUNT, - master.mcast_rejoin_count, + NM_TEAM_ATTRIBUTE_CONTROLLER_MCAST_REJOIN_COUNT, + controller.mcast_rejoin_count, NM_VALUE_TYPE_INT32, NM_SETTING_TEAM_MCAST_REJOIN_COUNT, _JS_KEYS("mcast_rejoin", "count"), _VAL_INT32_RANGE(-1, 0, G_MAXINT32), ), _INIT(0, - NM_TEAM_ATTRIBUTE_MASTER_MCAST_REJOIN_INTERVAL, - master.mcast_rejoin_interval, + NM_TEAM_ATTRIBUTE_CONTROLLER_MCAST_REJOIN_INTERVAL, + controller.mcast_rejoin_interval, NM_VALUE_TYPE_INT32, NM_SETTING_TEAM_MCAST_REJOIN_INTERVAL, _JS_KEYS("mcast_rejoin", "interval"), _VAL_INT32_RANGE(-1, 0, G_MAXINT32), ), _INIT(0, - NM_TEAM_ATTRIBUTE_MASTER_RUNNER, - master.runner, + NM_TEAM_ATTRIBUTE_CONTROLLER_RUNNER, + controller.runner, NM_VALUE_TYPE_STRING, NM_SETTING_TEAM_RUNNER, _JS_KEYS("runner", "name"), _VAL_STRING_RANGE(_valid_names_runner), ), _INIT(0, - NM_TEAM_ATTRIBUTE_MASTER_RUNNER_HWADDR_POLICY, - master.runner_hwaddr_policy, + NM_TEAM_ATTRIBUTE_CONTROLLER_RUNNER_HWADDR_POLICY, + controller.runner_hwaddr_policy, NM_VALUE_TYPE_STRING, NM_SETTING_TEAM_RUNNER_HWADDR_POLICY, _JS_KEYS("runner", "hwaddr_policy"), _VAL_STRING_RANGE(_valid_names_runner_hwaddr_policy), ), _INIT(0, - NM_TEAM_ATTRIBUTE_MASTER_RUNNER_TX_HASH, - master.runner_tx_hash, + NM_TEAM_ATTRIBUTE_CONTROLLER_RUNNER_TX_HASH, + controller.runner_tx_hash, NM_VALUE_TYPE_UNSPEC, NM_SETTING_TEAM_RUNNER_TX_HASH, _JS_KEYS("runner", "tx_hash"), _VAL_UNSPEC(), ), _INIT(0, - NM_TEAM_ATTRIBUTE_MASTER_RUNNER_TX_BALANCER, - master.runner_tx_balancer, + NM_TEAM_ATTRIBUTE_CONTROLLER_RUNNER_TX_BALANCER, + controller.runner_tx_balancer, NM_VALUE_TYPE_STRING, NM_SETTING_TEAM_RUNNER_TX_BALANCER, _JS_KEYS("runner", "tx_balancer", "name"), _VAL_STRING_RANGE(_valid_names_runner_tx_balancer), ), _INIT(0, - NM_TEAM_ATTRIBUTE_MASTER_RUNNER_TX_BALANCER_INTERVAL, - master.runner_tx_balancer_interval, + NM_TEAM_ATTRIBUTE_CONTROLLER_RUNNER_TX_BALANCER_INTERVAL, + controller.runner_tx_balancer_interval, NM_VALUE_TYPE_INT32, NM_SETTING_TEAM_RUNNER_TX_BALANCER_INTERVAL, _JS_KEYS("runner", "tx_balancer", "balancing_interval"), _VAL_INT32_RANGE(-1, 0, G_MAXINT32), ), _INIT(0, - NM_TEAM_ATTRIBUTE_MASTER_RUNNER_ACTIVE, - master.runner_active, + NM_TEAM_ATTRIBUTE_CONTROLLER_RUNNER_ACTIVE, + controller.runner_active, NM_VALUE_TYPE_BOOL, NM_SETTING_TEAM_RUNNER_ACTIVE, _JS_KEYS("runner", "active"), _VAL_BOOL(TRUE), ), _INIT(0, - NM_TEAM_ATTRIBUTE_MASTER_RUNNER_FAST_RATE, - master.runner_fast_rate, + NM_TEAM_ATTRIBUTE_CONTROLLER_RUNNER_FAST_RATE, + controller.runner_fast_rate, NM_VALUE_TYPE_BOOL, NM_SETTING_TEAM_RUNNER_FAST_RATE, _JS_KEYS("runner", "fast_rate"), _VAL_BOOL(FALSE), ), _INIT(0, - NM_TEAM_ATTRIBUTE_MASTER_RUNNER_SYS_PRIO, - master.runner_sys_prio, + NM_TEAM_ATTRIBUTE_CONTROLLER_RUNNER_SYS_PRIO, + controller.runner_sys_prio, NM_VALUE_TYPE_INT32, NM_SETTING_TEAM_RUNNER_SYS_PRIO, _JS_KEYS("runner", "sys_prio"), _VAL_INT32_RANGE(-1, 0, USHRT_MAX + 1), ), _INIT(0, - NM_TEAM_ATTRIBUTE_MASTER_RUNNER_MIN_PORTS, - master.runner_min_ports, + NM_TEAM_ATTRIBUTE_CONTROLLER_RUNNER_MIN_PORTS, + controller.runner_min_ports, NM_VALUE_TYPE_INT32, NM_SETTING_TEAM_RUNNER_MIN_PORTS, _JS_KEYS("runner", "min_ports"), _VAL_INT32_RANGE(-1, 1, UCHAR_MAX + 1), ), _INIT(0, - NM_TEAM_ATTRIBUTE_MASTER_RUNNER_AGG_SELECT_POLICY, - master.runner_agg_select_policy, + NM_TEAM_ATTRIBUTE_CONTROLLER_RUNNER_AGG_SELECT_POLICY, + controller.runner_agg_select_policy, NM_VALUE_TYPE_STRING, NM_SETTING_TEAM_RUNNER_AGG_SELECT_POLICY, _JS_KEYS("runner", "agg_select_policy"), @@ -437,7 +437,7 @@ _team_attr_data_ASSERT(const TeamAttrData *attr_data) nm_assert(attr_data); if (attr_data->for_port) nm_assert(attr_data == _team_attr_data_get(TRUE, attr_data->team_attr)); - if (attr_data->for_master) + if (attr_data->for_controller) nm_assert(attr_data == _team_attr_data_get(FALSE, attr_data->team_attr)); nm_assert((attr_data - team_attr_datas) == TEAM_ATTR_IDX(attr_data->for_port, attr_data->team_attr)); @@ -463,7 +463,7 @@ _team_attr_data_ASSERT(const TeamAttrData *attr_data) static gboolean _team_attr_data_is_relevant(const TeamAttrData *attr_data, gboolean is_port) { - return is_port ? attr_data->for_port : attr_data->for_master; + return is_port ? attr_data->for_port : attr_data->for_controller; } static const TeamAttrData * @@ -520,7 +520,7 @@ _team_attr_data_cmp(const TeamAttrData *attr_data, len, FALSE)); } - } else if (!is_port && attr_data->team_attr == NM_TEAM_ATTRIBUTE_MASTER_RUNNER_TX_HASH) { + } else if (!is_port && attr_data->team_attr == NM_TEAM_ATTRIBUTE_CONTROLLER_RUNNER_TX_HASH) { v_ptrarray_a = *((const GPtrArray *const *) val_a); v_ptrarray_b = *((const GPtrArray *const *) val_b); NM_CMP_RETURN(nm_strv_cmp_n(v_ptrarray_a ? (const char *const *) v_ptrarray_a->pdata : NULL, @@ -574,7 +574,7 @@ _team_attr_data_copy(const TeamAttrData *attr_data, g_ptr_array_unref(v_ptrarray_dst); *((GPtrArray **) dst) = dst_array; } - } else if (!is_port && attr_data->team_attr == NM_TEAM_ATTRIBUTE_MASTER_RUNNER_TX_HASH) { + } else if (!is_port && attr_data->team_attr == NM_TEAM_ATTRIBUTE_CONTROLLER_RUNNER_TX_HASH) { v_ptrarray_src = *((const GPtrArray *const *) src); v_ptrarray_dst = *((GPtrArray **) dst); len = (v_ptrarray_src ? v_ptrarray_src->len : 0u); @@ -631,7 +631,7 @@ _team_attr_data_to_json(const TeamAttrData *attr_data, return; } - if (!is_port && attr_data->team_attr == NM_TEAM_ATTRIBUTE_MASTER_RUNNER_TX_HASH) { + if (!is_port && attr_data->team_attr == NM_TEAM_ATTRIBUTE_CONTROLLER_RUNNER_TX_HASH) { const GPtrArray *v_ptrarray = *((const GPtrArray *const *) p_field); if (!v_ptrarray) @@ -664,8 +664,8 @@ _team_setting_ASSERT(const NMTeamSetting *self) nm_assert(self->d._js_str); } nm_assert(self->d.link_watchers); - nm_assert(self->d.is_port || !self->d.master.runner_tx_hash - || self->d.master.runner_tx_hash->len > 0); + nm_assert(self->d.is_port || !self->d.controller.runner_tx_hash + || self->d.controller.runner_tx_hash->len > 0); #endif } @@ -736,9 +736,10 @@ _team_setting_get_field(const NMTeamSetting *self, const TeamAttrData *attr_data nm_assert(_team_attr_data_is_relevant(attr_data, self->d.is_port)); #if NM_MORE_ASSERTS > 5 - if (attr_data->for_master && attr_data->team_attr == NM_TEAM_ATTRIBUTE_MASTER_RUNNER_SYS_PRIO) + if (attr_data->for_controller + && attr_data->team_attr == NM_TEAM_ATTRIBUTE_CONTROLLER_RUNNER_SYS_PRIO) nm_assert((gpointer) (((char *) self) + attr_data->field_offset) - == &self->d.master.runner_sys_prio); + == &self->d.controller.runner_sys_prio); #endif return (((char *) self) + attr_data->field_offset); @@ -1088,57 +1089,58 @@ nm_team_setting_value_link_watchers_set_list(NMTeamSetting *sel /*****************************************************************************/ guint32 -nm_team_setting_value_master_runner_tx_hash_add(NMTeamSetting *self, const char *txhash) +nm_team_setting_value_controller_runner_tx_hash_add(NMTeamSetting *self, const char *txhash) { gboolean changed; guint i; - if (!self->d.master.runner_tx_hash) - self->_data_priv.master.runner_tx_hash = g_ptr_array_new_with_free_func(g_free); + if (!self->d.controller.runner_tx_hash) + self->_data_priv.controller.runner_tx_hash = g_ptr_array_new_with_free_func(g_free); else { - for (i = 0; i < self->d.master.runner_tx_hash->len; i++) { - if (nm_streq(txhash, self->d.master.runner_tx_hash->pdata[i])) { + for (i = 0; i < self->d.controller.runner_tx_hash->len; i++) { + if (nm_streq(txhash, self->d.controller.runner_tx_hash->pdata[i])) { changed = FALSE; goto out; } } } changed = TRUE; - g_ptr_array_add((GPtrArray *) self->d.master.runner_tx_hash, g_strdup(txhash)); + g_ptr_array_add((GPtrArray *) self->d.controller.runner_tx_hash, g_strdup(txhash)); out: return _team_setting_attribute_changed_attr(self, - NM_TEAM_ATTRIBUTE_MASTER_RUNNER_TX_HASH, + NM_TEAM_ATTRIBUTE_CONTROLLER_RUNNER_TX_HASH, changed, SET_FIELD_MODE_SET_UNLESS_DEFAULT, RESET_JSON_YES); } guint32 -nm_team_setting_value_master_runner_tx_hash_remove(NMTeamSetting *self, guint idx) +nm_team_setting_value_controller_runner_tx_hash_remove(NMTeamSetting *self, guint idx) { - g_ptr_array_remove_index((GPtrArray *) self->d.master.runner_tx_hash, idx); + g_ptr_array_remove_index((GPtrArray *) self->d.controller.runner_tx_hash, idx); return _team_setting_attribute_changed_attr(self, - NM_TEAM_ATTRIBUTE_MASTER_RUNNER_TX_HASH, + NM_TEAM_ATTRIBUTE_CONTROLLER_RUNNER_TX_HASH, TRUE, SET_FIELD_MODE_SET_UNLESS_DEFAULT, RESET_JSON_YES); } static guint32 -_team_setting_value_master_runner_tx_hash_set_list(NMTeamSetting *self, - const char *const *arr, - guint len, - SetFieldModeEnum set_field_mode, - ResetJsonEnum reset_json) +_team_setting_value_controller_runner_tx_hash_set_list(NMTeamSetting *self, + const char *const *arr, + guint len, + SetFieldModeEnum set_field_mode, + ResetJsonEnum reset_json) { _nm_unused gs_unref_ptrarray GPtrArray *old_val_destroy = NULL; gboolean changed; guint i; - if (nm_strv_cmp_n(self->d.master.runner_tx_hash - ? (const char *const *) self->d.master.runner_tx_hash->pdata + if (nm_strv_cmp_n(self->d.controller.runner_tx_hash + ? (const char *const *) self->d.controller.runner_tx_hash->pdata : NULL, - self->d.master.runner_tx_hash ? self->d.master.runner_tx_hash->len : 0u, + self->d.controller.runner_tx_hash ? self->d.controller.runner_tx_hash->len + : 0u, arr, len) == 0) { @@ -1148,34 +1150,34 @@ _team_setting_value_master_runner_tx_hash_set_list(NMTeamSetting *self, changed = TRUE; - old_val_destroy = (GPtrArray *) g_steal_pointer(&self->_data_priv.master.runner_tx_hash); + old_val_destroy = (GPtrArray *) g_steal_pointer(&self->_data_priv.controller.runner_tx_hash); for (i = 0; i < len; i++) { if (!arr[i]) continue; - if (!self->d.master.runner_tx_hash) - self->_data_priv.master.runner_tx_hash = g_ptr_array_new_with_free_func(g_free); - g_ptr_array_add((GPtrArray *) self->d.master.runner_tx_hash, g_strdup(arr[i])); + if (!self->d.controller.runner_tx_hash) + self->_data_priv.controller.runner_tx_hash = g_ptr_array_new_with_free_func(g_free); + g_ptr_array_add((GPtrArray *) self->d.controller.runner_tx_hash, g_strdup(arr[i])); } out: return _team_setting_attribute_changed_attr(self, - NM_TEAM_ATTRIBUTE_MASTER_RUNNER_TX_HASH, + NM_TEAM_ATTRIBUTE_CONTROLLER_RUNNER_TX_HASH, changed, set_field_mode, reset_json); } guint32 -nm_team_setting_value_master_runner_tx_hash_set_list(NMTeamSetting *self, - const char *const *arr, - guint len) +nm_team_setting_value_controller_runner_tx_hash_set_list(NMTeamSetting *self, + const char *const *arr, + guint len) { - return _team_setting_value_master_runner_tx_hash_set_list(self, - arr, - len, - SET_FIELD_MODE_SET_UNLESS_DEFAULT, - RESET_JSON_YES); + return _team_setting_value_controller_runner_tx_hash_set_list(self, + arr, + len, + SET_FIELD_MODE_SET_UNLESS_DEFAULT, + RESET_JSON_YES); } /*****************************************************************************/ @@ -1769,28 +1771,28 @@ nm_team_setting_config_get(const NMTeamSetting *self) list_is_empty = FALSE; } else { static const NMTeamAttribute attr_lst_runner_pt1[] = { - NM_TEAM_ATTRIBUTE_MASTER_RUNNER, - NM_TEAM_ATTRIBUTE_MASTER_RUNNER_HWADDR_POLICY, - NM_TEAM_ATTRIBUTE_MASTER_RUNNER_TX_HASH, + NM_TEAM_ATTRIBUTE_CONTROLLER_RUNNER, + NM_TEAM_ATTRIBUTE_CONTROLLER_RUNNER_HWADDR_POLICY, + NM_TEAM_ATTRIBUTE_CONTROLLER_RUNNER_TX_HASH, }; static const NMTeamAttribute attr_lst_runner_pt2[] = { - NM_TEAM_ATTRIBUTE_MASTER_RUNNER_TX_BALANCER, - NM_TEAM_ATTRIBUTE_MASTER_RUNNER_TX_BALANCER_INTERVAL, + NM_TEAM_ATTRIBUTE_CONTROLLER_RUNNER_TX_BALANCER, + NM_TEAM_ATTRIBUTE_CONTROLLER_RUNNER_TX_BALANCER_INTERVAL, }; static const NMTeamAttribute attr_lst_runner_pt3[] = { - NM_TEAM_ATTRIBUTE_MASTER_RUNNER_ACTIVE, - NM_TEAM_ATTRIBUTE_MASTER_RUNNER_FAST_RATE, - NM_TEAM_ATTRIBUTE_MASTER_RUNNER_SYS_PRIO, - NM_TEAM_ATTRIBUTE_MASTER_RUNNER_MIN_PORTS, - NM_TEAM_ATTRIBUTE_MASTER_RUNNER_AGG_SELECT_POLICY, + NM_TEAM_ATTRIBUTE_CONTROLLER_RUNNER_ACTIVE, + NM_TEAM_ATTRIBUTE_CONTROLLER_RUNNER_FAST_RATE, + NM_TEAM_ATTRIBUTE_CONTROLLER_RUNNER_SYS_PRIO, + NM_TEAM_ATTRIBUTE_CONTROLLER_RUNNER_MIN_PORTS, + NM_TEAM_ATTRIBUTE_CONTROLLER_RUNNER_AGG_SELECT_POLICY, }; static const NMTeamAttribute attr_lst_notify_peers[] = { - NM_TEAM_ATTRIBUTE_MASTER_NOTIFY_PEERS_COUNT, - NM_TEAM_ATTRIBUTE_MASTER_NOTIFY_PEERS_INTERVAL, + NM_TEAM_ATTRIBUTE_CONTROLLER_NOTIFY_PEERS_COUNT, + NM_TEAM_ATTRIBUTE_CONTROLLER_NOTIFY_PEERS_INTERVAL, }; static const NMTeamAttribute attr_lst_mcast_rejoin[] = { - NM_TEAM_ATTRIBUTE_MASTER_MCAST_REJOIN_COUNT, - NM_TEAM_ATTRIBUTE_MASTER_MCAST_REJOIN_INTERVAL, + NM_TEAM_ATTRIBUTE_CONTROLLER_MCAST_REJOIN_COUNT, + NM_TEAM_ATTRIBUTE_CONTROLLER_MCAST_REJOIN_INTERVAL, }; if (_team_setting_has_fields_any_v(self, @@ -2012,7 +2014,7 @@ _js_parse_unpack(const NMJsonVt *vt, NMValueTypUnion out_val_lst[static _NM_TEAM_ATTRIBUTE_NUM], gboolean *out_unrecognized_content, GPtrArray **out_ptr_array_link_watchers_free, - GPtrArray **out_ptr_array_master_runner_tx_hash_free) + GPtrArray **out_ptr_array_controller_runner_tx_hash_free) { const TeamAttrData *attr_data; @@ -2069,11 +2071,12 @@ _js_parse_unpack(const NMJsonVt *vt, p_out_val->v_ptrarray = link_watchers; *out_ptr_array_link_watchers_free = link_watchers; } - } else if (!is_port && attr_data->team_attr == NM_TEAM_ATTRIBUTE_MASTER_RUNNER_TX_HASH) { + } else if (!is_port + && attr_data->team_attr == NM_TEAM_ATTRIBUTE_CONTROLLER_RUNNER_TX_HASH) { GPtrArray *strv = NULL; - nm_assert(out_ptr_array_master_runner_tx_hash_free - && !*out_ptr_array_master_runner_tx_hash_free); + nm_assert(out_ptr_array_controller_runner_tx_hash_free + && !*out_ptr_array_controller_runner_tx_hash_free); if (nm_json_is_array(arg_js_obj)) { gsize i, len; @@ -2096,8 +2099,8 @@ _js_parse_unpack(const NMJsonVt *vt, g_ptr_array_add(strv, (char *) v_string); } } - valid = TRUE; - *out_ptr_array_master_runner_tx_hash_free = strv; + valid = TRUE; + *out_ptr_array_controller_runner_tx_hash_free = strv; } p_out_val->v_ptrarray = strv; } else @@ -2154,8 +2157,8 @@ nm_team_setting_config_set(NMTeamSetting *self, const char *js_str) nm_json_t *found_keys[_NM_TEAM_ATTRIBUTE_NUM] = { NULL, }; - gs_unref_ptrarray GPtrArray *ptr_array_master_runner_tx_hash_free = NULL; - gs_unref_ptrarray GPtrArray *ptr_array_link_watchers_free = NULL; + gs_unref_ptrarray GPtrArray *ptr_array_controller_runner_tx_hash_free = NULL; + gs_unref_ptrarray GPtrArray *ptr_array_link_watchers_free = NULL; _js_parse_locate_keys(vt, self, root_js_obj, found_keys, &unrecognized_content); @@ -2166,7 +2169,7 @@ nm_team_setting_config_set(NMTeamSetting *self, const char *js_str) val_lst, &unrecognized_content, &ptr_array_link_watchers_free, - &ptr_array_master_runner_tx_hash_free); + &ptr_array_controller_runner_tx_hash_free); do_set_default = FALSE; @@ -2199,14 +2202,14 @@ _team_setting_prefix_error_plain(gboolean is_port, const char *property_name, GE static void _team_setting_prefix_error(const NMTeamSetting *self, - const char *prop_name_master, + const char *prop_name_controller, const char *prop_name_port, GError **error) { _team_setting_ASSERT(self); - nm_assert(self->d.is_port ? (!!prop_name_port) : (!!prop_name_master)); + nm_assert(self->d.is_port ? (!!prop_name_port) : (!!prop_name_controller)); _team_setting_prefix_error_plain(self->d.is_port, - self->d.is_port ? prop_name_port : prop_name_master, + self->d.is_port ? prop_name_port : prop_name_controller, error); } @@ -2258,10 +2261,11 @@ _team_setting_verify_properties(const NMTeamSetting *self, GError **error) nm_assert_not_reached(); } - if (!self->d.is_port && attr_data->team_attr == NM_TEAM_ATTRIBUTE_MASTER_RUNNER_TX_HASH) { - if (self->d.master.runner_tx_hash) { - for (i = 0; i < self->d.master.runner_tx_hash->len; i++) { - const char *val = self->d.master.runner_tx_hash->pdata[i]; + if (!self->d.is_port + && attr_data->team_attr == NM_TEAM_ATTRIBUTE_CONTROLLER_RUNNER_TX_HASH) { + if (self->d.controller.runner_tx_hash) { + for (i = 0; i < self->d.controller.runner_tx_hash->len; i++) { + const char *val = self->d.controller.runner_tx_hash->pdata[i]; if (!val || !nm_strv_contains(_valid_names_runner_tx_hash, -1, val)) { g_set_error(error, @@ -2288,8 +2292,8 @@ _team_setting_verify_properties(const NMTeamSetting *self, GError **error) if (!_team_setting_has_field(self, attr_data)) continue; - if (self->d.master.runner - && nm_strv_contains(e->valid_runners, -1, self->d.master.runner)) + if (self->d.controller.runner + && nm_strv_contains(e->valid_runners, -1, self->d.controller.runner)) continue; if (e->valid_runners[1] == NULL) { g_set_error(error, @@ -2542,7 +2546,7 @@ nm_team_setting_reset_from_dbus(NMTeamSetting *self, else if (attr_data->team_attr == NM_TEAM_ATTRIBUTE_LINK_WATCHERS) variant_type = G_VARIANT_TYPE("aa{sv}"); else if (!self->d.is_port - && attr_data->team_attr == NM_TEAM_ATTRIBUTE_MASTER_RUNNER_TX_HASH) + && attr_data->team_attr == NM_TEAM_ATTRIBUTE_CONTROLLER_RUNNER_TX_HASH) variant_type = G_VARIANT_TYPE_STRING_ARRAY; else nm_assert_not_reached(); @@ -2645,12 +2649,12 @@ nm_team_setting_reset_from_dbus(NMTeamSetting *self, SET_FIELD_MODE_SET, RESET_JSON_NO); } else if (!self->d.is_port - && attr_data->team_attr == NM_TEAM_ATTRIBUTE_MASTER_RUNNER_TX_HASH) { + && attr_data->team_attr == NM_TEAM_ATTRIBUTE_CONTROLLER_RUNNER_TX_HASH) { gs_free const char **strv = NULL; gsize len; strv = g_variant_get_strv(variants[attr_data->team_attr], &len); - changed_flags = _team_setting_value_master_runner_tx_hash_set_list( + changed_flags = _team_setting_value_controller_runner_tx_hash_set_list( self, strv, NM_MIN(len, (gsize) G_MAXUINT), @@ -2756,12 +2760,12 @@ _nm_team_settings_property_to_dbus(_NM_SETT_INFO_PROP_TO_DBUS_FCN_ARGS _nm_nil) } if (attr_data->team_attr == NM_TEAM_ATTRIBUTE_LINK_WATCHERS) return _nm_utils_team_link_watchers_to_variant(self->d.link_watchers); - if (!self->d.is_port && attr_data->team_attr == NM_TEAM_ATTRIBUTE_MASTER_RUNNER_TX_HASH) { - return g_variant_new_strv(self->d.master.runner_tx_hash - ? (const char *const *) self->d.master.runner_tx_hash->pdata - : NULL, - self->d.master.runner_tx_hash ? self->d.master.runner_tx_hash->len - : 0u); + if (!self->d.is_port && attr_data->team_attr == NM_TEAM_ATTRIBUTE_CONTROLLER_RUNNER_TX_HASH) { + return g_variant_new_strv( + self->d.controller.runner_tx_hash + ? (const char *const *) self->d.controller.runner_tx_hash->pdata + : NULL, + self->d.controller.runner_tx_hash ? self->d.controller.runner_tx_hash->len : 0u); } nm_assert_not_reached(); @@ -2836,12 +2840,12 @@ nm_team_setting_free(NMTeamSetting *self) _team_setting_ASSERT(self); if (!self->d.is_port) { - nm_clear_pointer(((GPtrArray **) &self->_data_priv.master.runner_tx_hash), + nm_clear_pointer(((GPtrArray **) &self->_data_priv.controller.runner_tx_hash), g_ptr_array_unref); - g_free((char *) self->_data_priv.master.runner); - g_free((char *) self->_data_priv.master.runner_hwaddr_policy); - g_free((char *) self->_data_priv.master.runner_tx_balancer); - g_free((char *) self->_data_priv.master.runner_agg_select_policy); + g_free((char *) self->_data_priv.controller.runner); + g_free((char *) self->_data_priv.controller.runner_hwaddr_policy); + g_free((char *) self->_data_priv.controller.runner_tx_balancer); + g_free((char *) self->_data_priv.controller.runner_agg_select_policy); } g_ptr_array_unref((GPtrArray *) self->_data_priv.link_watchers); g_free((char *) self->_data_priv._js_str); diff --git a/src/libnm-core-impl/nm-team-utils.h b/src/libnm-core-impl/nm-team-utils.h index 0210cb26..5df14235 100644 --- a/src/libnm-core-impl/nm-team-utils.h +++ b/src/libnm-core-impl/nm-team-utils.h @@ -25,21 +25,21 @@ typedef enum { _NM_TEAM_ATTRIBUTE_START = 3, - NM_TEAM_ATTRIBUTE_MASTER_NOTIFY_PEERS_COUNT = _NM_TEAM_ATTRIBUTE_START, - NM_TEAM_ATTRIBUTE_MASTER_NOTIFY_PEERS_INTERVAL, - NM_TEAM_ATTRIBUTE_MASTER_MCAST_REJOIN_COUNT, - NM_TEAM_ATTRIBUTE_MASTER_MCAST_REJOIN_INTERVAL, - NM_TEAM_ATTRIBUTE_MASTER_RUNNER, - NM_TEAM_ATTRIBUTE_MASTER_RUNNER_HWADDR_POLICY, - NM_TEAM_ATTRIBUTE_MASTER_RUNNER_TX_HASH, - NM_TEAM_ATTRIBUTE_MASTER_RUNNER_TX_BALANCER, - NM_TEAM_ATTRIBUTE_MASTER_RUNNER_TX_BALANCER_INTERVAL, - NM_TEAM_ATTRIBUTE_MASTER_RUNNER_ACTIVE, - NM_TEAM_ATTRIBUTE_MASTER_RUNNER_FAST_RATE, - NM_TEAM_ATTRIBUTE_MASTER_RUNNER_SYS_PRIO, - NM_TEAM_ATTRIBUTE_MASTER_RUNNER_MIN_PORTS, - NM_TEAM_ATTRIBUTE_MASTER_RUNNER_AGG_SELECT_POLICY, - _NM_TEAM_ATTRIBUTE_MASTER_NUM, + NM_TEAM_ATTRIBUTE_CONTROLLER_NOTIFY_PEERS_COUNT = _NM_TEAM_ATTRIBUTE_START, + NM_TEAM_ATTRIBUTE_CONTROLLER_NOTIFY_PEERS_INTERVAL, + NM_TEAM_ATTRIBUTE_CONTROLLER_MCAST_REJOIN_COUNT, + NM_TEAM_ATTRIBUTE_CONTROLLER_MCAST_REJOIN_INTERVAL, + NM_TEAM_ATTRIBUTE_CONTROLLER_RUNNER, + NM_TEAM_ATTRIBUTE_CONTROLLER_RUNNER_HWADDR_POLICY, + NM_TEAM_ATTRIBUTE_CONTROLLER_RUNNER_TX_HASH, + NM_TEAM_ATTRIBUTE_CONTROLLER_RUNNER_TX_BALANCER, + NM_TEAM_ATTRIBUTE_CONTROLLER_RUNNER_TX_BALANCER_INTERVAL, + NM_TEAM_ATTRIBUTE_CONTROLLER_RUNNER_ACTIVE, + NM_TEAM_ATTRIBUTE_CONTROLLER_RUNNER_FAST_RATE, + NM_TEAM_ATTRIBUTE_CONTROLLER_RUNNER_SYS_PRIO, + NM_TEAM_ATTRIBUTE_CONTROLLER_RUNNER_MIN_PORTS, + NM_TEAM_ATTRIBUTE_CONTROLLER_RUNNER_AGG_SELECT_POLICY, + _NM_TEAM_ATTRIBUTE_CONTROLLER_NUM, NM_TEAM_ATTRIBUTE_PORT_QUEUE_ID = _NM_TEAM_ATTRIBUTE_START, NM_TEAM_ATTRIBUTE_PORT_PRIO, @@ -49,7 +49,7 @@ typedef enum { _NM_TEAM_ATTRIBUTE_PORT_NUM, _NM_TEAM_ATTRIBUTE_NUM = - NM_MAX_CONST(_NM_TEAM_ATTRIBUTE_MASTER_NUM, _NM_TEAM_ATTRIBUTE_PORT_NUM), + NM_MAX_CONST(_NM_TEAM_ATTRIBUTE_CONTROLLER_NUM, _NM_TEAM_ATTRIBUTE_PORT_NUM), } NMTeamAttribute; @@ -101,7 +101,7 @@ struct _NMTeamSettingData { gint32 runner_tx_balancer_interval; bool runner_active; bool runner_fast_rate; - } master; + } controller; struct { gint32 queue_id; gint32 prio; @@ -216,13 +216,14 @@ guint32 nm_team_setting_value_link_watchers_set_list(NMTeamSetting /*****************************************************************************/ -guint32 nm_team_setting_value_master_runner_tx_hash_add(NMTeamSetting *self, const char *txhash); +guint32 nm_team_setting_value_controller_runner_tx_hash_add(NMTeamSetting *self, + const char *txhash); -guint32 nm_team_setting_value_master_runner_tx_hash_remove(NMTeamSetting *self, guint idx); +guint32 nm_team_setting_value_controller_runner_tx_hash_remove(NMTeamSetting *self, guint idx); -guint32 nm_team_setting_value_master_runner_tx_hash_set_list(NMTeamSetting *self, - const char *const *arr, - guint len); +guint32 nm_team_setting_value_controller_runner_tx_hash_set_list(NMTeamSetting *self, + const char *const *arr, + guint len); /*****************************************************************************/ diff --git a/src/libnm-core-impl/nm-utils.c b/src/libnm-core-impl/nm-utils.c index 745b1f33..f7f4e770 100644 --- a/src/libnm-core-impl/nm-utils.c +++ b/src/libnm-core-impl/nm-utils.c @@ -4903,9 +4903,9 @@ _nm_utils_dhcp_duid_valid(const char *duid, GBytes **out_duid_bin) * If @virtual_type is %NM_TYPE_SETTING_VLAN, then this checks if * @other_type is a valid type for the parent of a VLAN. * - * If @virtual_type is a "master" type (eg, %NM_TYPE_SETTING_BRIDGE), - * then this checks if @other_type is a valid type for a slave of that - * master. + * If @virtual_type is a "controller" type (eg, %NM_TYPE_SETTING_BRIDGE), + * then this checks if @other_type is a valid type for a port of that + * controller. * * Note that even if this returns %TRUE it is not guaranteed that * <emphasis>every</emphasis> connection of type @other_type is diff --git a/src/libnm-core-impl/tests/test-general.c b/src/libnm-core-impl/tests/test-general.c index f745d059..0a39010c 100644 --- a/src/libnm-core-impl/tests/test-general.c +++ b/src/libnm-core-impl/tests/test-general.c @@ -6231,19 +6231,19 @@ test_connection_normalize_type(void) } static void -test_connection_normalize_slave_type_1(void) +test_connection_normalize_port_type_1(void) { gs_unref_object NMConnection *con = NULL; NMSettingConnection *s_con; - con = nmtst_create_minimal_connection("test_connection_normalize_slave_type_1", + con = nmtst_create_minimal_connection("test_connection_normalize_port_type_1", "cc4cd5df-45dc-483e-b291-6b76c2338ecb", NM_SETTING_WIRED_SETTING_NAME, &s_con); g_object_set(s_con, NM_SETTING_CONNECTION_CONTROLLER, - "master0", + "controller0", NM_SETTING_CONNECTION_PORT_TYPE, "invalid-type", NULL); @@ -6265,19 +6265,19 @@ test_connection_normalize_slave_type_1(void) } static void -test_connection_normalize_slave_type_2(void) +test_connection_normalize_port_type_2(void) { gs_unref_object NMConnection *con = NULL; NMSettingConnection *s_con; - con = nmtst_create_minimal_connection("test_connection_normalize_slave_type_2", + con = nmtst_create_minimal_connection("test_connection_normalize_port_type_2", "40bea008-ca72-439a-946b-e65f827656f9", NM_SETTING_WIRED_SETTING_NAME, &s_con); g_object_set(s_con, NM_SETTING_CONNECTION_CONTROLLER, - "master0", + "controller0", NM_SETTING_CONNECTION_PORT_TYPE, "invalid-type", NULL); @@ -6576,7 +6576,7 @@ test_connection_normalize_ovs_interface_type_system(gconstpointer test_data) case 1: g_object_set(s_con, NM_SETTING_CONNECTION_CONTROLLER, - "master0", + "controller0", NM_SETTING_CONNECTION_PORT_TYPE, NM_SETTING_OVS_PORT_SETTING_NAME, NULL); @@ -6597,7 +6597,7 @@ test_connection_normalize_ovs_interface_type_system(gconstpointer test_data) case 2: g_object_set(s_con, NM_SETTING_CONNECTION_CONTROLLER, - "master0", + "controller0", NM_SETTING_CONNECTION_PORT_TYPE, NM_SETTING_OVS_PORT_SETTING_NAME, NULL); @@ -6620,7 +6620,7 @@ test_connection_normalize_ovs_interface_type_system(gconstpointer test_data) case 3: g_object_set(s_con, NM_SETTING_CONNECTION_CONTROLLER, - "master0", + "controller0", NM_SETTING_CONNECTION_PORT_TYPE, NM_SETTING_OVS_PORT_SETTING_NAME, NULL); @@ -6638,7 +6638,7 @@ test_connection_normalize_ovs_interface_type_system(gconstpointer test_data) case 4: g_object_set(s_con, NM_SETTING_CONNECTION_CONTROLLER, - "master0", + "controller0", NM_SETTING_CONNECTION_PORT_TYPE, NM_SETTING_OVS_PORT_SETTING_NAME, NULL); @@ -6653,7 +6653,7 @@ test_connection_normalize_ovs_interface_type_system(gconstpointer test_data) NM_CONNECTION_ERROR_INVALID_PROPERTY); break; case 5: - g_object_set(s_con, NM_SETTING_CONNECTION_CONTROLLER, "master0", NULL); + g_object_set(s_con, NM_SETTING_CONNECTION_CONTROLLER, "controller0", NULL); s_ovs_if = NM_SETTING_OVS_INTERFACE(nm_setting_ovs_interface_new()); nm_connection_add_setting(con, NM_SETTING(s_ovs_if)); @@ -6675,7 +6675,7 @@ test_connection_normalize_ovs_interface_type_system(gconstpointer test_data) case 6: g_object_set(s_con, NM_SETTING_CONNECTION_CONTROLLER, - "master0", + "controller0", NM_SETTING_CONNECTION_PORT_TYPE, NM_SETTING_BRIDGE_SETTING_NAME, NULL); @@ -6691,7 +6691,7 @@ test_connection_normalize_ovs_interface_type_system(gconstpointer test_data) case 7: g_object_set(s_con, NM_SETTING_CONNECTION_CONTROLLER, - "master0", + "controller0", NM_SETTING_CONNECTION_PORT_TYPE, NM_SETTING_BRIDGE_SETTING_NAME, NULL); @@ -6738,7 +6738,7 @@ test_connection_normalize_ovs_interface_type_ovs_interface(gconstpointer test_da NM_CONNECTION_ERROR_INVALID_PROPERTY); break; case 2: - g_object_set(s_con, NM_SETTING_CONNECTION_CONTROLLER, "master0", NULL); + g_object_set(s_con, NM_SETTING_CONNECTION_CONTROLLER, "controller0", NULL); nmtst_assert_connection_verifies_after_normalization(con, NM_CONNECTION_ERROR, NM_CONNECTION_ERROR_MISSING_PROPERTY); @@ -6759,7 +6759,7 @@ test_connection_normalize_ovs_interface_type_ovs_interface(gconstpointer test_da case 3: g_object_set(s_con, NM_SETTING_CONNECTION_CONTROLLER, - "master0", + "controller0", NM_SETTING_CONNECTION_PORT_TYPE, NM_SETTING_OVS_PORT_SETTING_NAME, NULL); @@ -6781,7 +6781,7 @@ test_connection_normalize_ovs_interface_type_ovs_interface(gconstpointer test_da g_assert_cmpstr(nm_setting_ovs_interface_get_interface_type(s_ovs_if), ==, "internal"); break; case 4: - g_object_set(s_con, NM_SETTING_CONNECTION_CONTROLLER, "master0", NULL); + g_object_set(s_con, NM_SETTING_CONNECTION_CONTROLLER, "controller0", NULL); g_object_set(s_ovs_if, NM_SETTING_OVS_INTERFACE_TYPE, "internal", NULL); nmtst_assert_connection_verifies_after_normalization(con, NM_CONNECTION_ERROR, @@ -6803,7 +6803,7 @@ test_connection_normalize_ovs_interface_type_ovs_interface(gconstpointer test_da case 5: g_object_set(s_con, NM_SETTING_CONNECTION_CONTROLLER, - "master0", + "controller0", NM_SETTING_CONNECTION_PORT_TYPE, NM_SETTING_OVS_PORT_SETTING_NAME, NULL); @@ -6826,7 +6826,7 @@ test_connection_normalize_ovs_interface_type_ovs_interface(gconstpointer test_da case 6: g_object_set(s_con, NM_SETTING_CONNECTION_CONTROLLER, - "master0", + "controller0", NM_SETTING_CONNECTION_PORT_TYPE, NM_SETTING_OVS_PORT_SETTING_NAME, NULL); @@ -6849,7 +6849,7 @@ test_connection_normalize_ovs_interface_type_ovs_interface(gconstpointer test_da case 7: g_object_set(s_con, NM_SETTING_CONNECTION_CONTROLLER, - "master0", + "controller0", NM_SETTING_CONNECTION_PORT_TYPE, NM_SETTING_OVS_PORT_SETTING_NAME, NULL); @@ -6861,7 +6861,7 @@ test_connection_normalize_ovs_interface_type_ovs_interface(gconstpointer test_da case 8: g_object_set(s_con, NM_SETTING_CONNECTION_CONTROLLER, - "master0", + "controller0", NM_SETTING_CONNECTION_PORT_TYPE, NM_SETTING_OVS_PORT_SETTING_NAME, NULL); @@ -6873,7 +6873,7 @@ test_connection_normalize_ovs_interface_type_ovs_interface(gconstpointer test_da case 9: g_object_set(s_con, NM_SETTING_CONNECTION_CONTROLLER, - "master0", + "controller0", NM_SETTING_CONNECTION_PORT_TYPE, NM_SETTING_OVS_PORT_SETTING_NAME, NULL); @@ -6885,7 +6885,7 @@ test_connection_normalize_ovs_interface_type_ovs_interface(gconstpointer test_da case 10: g_object_set(s_con, NM_SETTING_CONNECTION_CONTROLLER, - "master0", + "controller0", NM_SETTING_CONNECTION_PORT_TYPE, NM_SETTING_OVS_PORT_SETTING_NAME, NULL); @@ -6898,7 +6898,7 @@ test_connection_normalize_ovs_interface_type_ovs_interface(gconstpointer test_da case 11: g_object_set(s_con, NM_SETTING_CONNECTION_CONTROLLER, - "master0", + "controller0", NM_SETTING_CONNECTION_PORT_TYPE, NM_SETTING_OVS_PORT_SETTING_NAME, NM_SETTING_CONNECTION_INTERFACE_NAME, @@ -6913,7 +6913,7 @@ test_connection_normalize_ovs_interface_type_ovs_interface(gconstpointer test_da case 12: g_object_set(s_con, NM_SETTING_CONNECTION_CONTROLLER, - "master0", + "controller0", NM_SETTING_CONNECTION_PORT_TYPE, NM_SETTING_OVS_PORT_SETTING_NAME, NM_SETTING_CONNECTION_INTERFACE_NAME, @@ -10705,7 +10705,7 @@ test_connection_ovs_ifname(gconstpointer test_data) g_object_set(s_con, NM_SETTING_CONNECTION_CONTROLLER, - "master0", + "controller0", NM_SETTING_CONNECTION_PORT_TYPE, NM_SETTING_OVS_BRIDGE_SETTING_NAME, NULL); @@ -10723,7 +10723,7 @@ test_connection_ovs_ifname(gconstpointer test_data) g_object_set(s_con, NM_SETTING_CONNECTION_CONTROLLER, - "master0", + "controller0", NM_SETTING_CONNECTION_PORT_TYPE, NM_SETTING_OVS_PORT_SETTING_NAME, NULL); @@ -10750,7 +10750,7 @@ test_connection_ovs_ifname(gconstpointer test_data) g_object_set(s_con, NM_SETTING_CONNECTION_CONTROLLER, - "master0", + "controller0", NM_SETTING_CONNECTION_PORT_TYPE, NM_SETTING_OVS_PORT_SETTING_NAME, NULL); @@ -10766,7 +10766,7 @@ test_connection_ovs_ifname(gconstpointer test_data) g_object_set(s_con, NM_SETTING_CONNECTION_CONTROLLER, - "master0", + "controller0", NM_SETTING_CONNECTION_PORT_TYPE, NM_SETTING_OVS_PORT_SETTING_NAME, NULL); @@ -10792,7 +10792,7 @@ test_connection_ovs_ifname(gconstpointer test_data) g_object_set(s_con, NM_SETTING_CONNECTION_CONTROLLER, - "master0", + "controller0", NM_SETTING_CONNECTION_PORT_TYPE, NM_SETTING_OVS_PORT_SETTING_NAME, NULL); @@ -11717,10 +11717,10 @@ main(int argc, char **argv) test_connection_normalize_virtual_iface_name); g_test_add_func("/core/general/test_connection_normalize_uuid", test_connection_normalize_uuid); g_test_add_func("/core/general/test_connection_normalize_type", test_connection_normalize_type); - g_test_add_func("/core/general/test_connection_normalize_slave_type_1", - test_connection_normalize_slave_type_1); - g_test_add_func("/core/general/test_connection_normalize_slave_type_2", - test_connection_normalize_slave_type_2); + g_test_add_func("/core/general/test_connection_normalize_port_type_1", + test_connection_normalize_port_type_1); + g_test_add_func("/core/general/test_connection_normalize_port_type_2", + test_connection_normalize_port_type_2); g_test_add_func("/core/general/test_connection_normalize_infiniband", test_connection_normalize_infiniband); g_test_add_func("/core/general/test_connection_normalize_gateway_never_default", diff --git a/src/libnm-core-impl/tests/test-keyfile.c b/src/libnm-core-impl/tests/test-keyfile.c index 9f546971..1912782e 100644 --- a/src/libnm-core-impl/tests/test-keyfile.c +++ b/src/libnm-core-impl/tests/test-keyfile.c @@ -196,7 +196,7 @@ _nm_keyfile_read(GKeyFile *keyfile, { NMSettingConnection *s_con; - /* a non-slave connection must have a proxy setting, but + /* a non-port connection must have a proxy setting, but * keyfile reader does not add that (unless a [proxy] section * is present. */ s_con = nm_connection_get_setting_connection(con); @@ -857,8 +857,8 @@ test_bridge_port_vlans(void) "id=t\n" "type=dummy\n" "interface-name=dummy1\n" - "master=br0\n" - "slave-type=bridge\n" + "controller=br0\n" + "port-type=bridge\n" "\n" "[bridge-port]\n" "vlans=4094 pvid , 10-20 untagged\n" |