diff --git a/Makefile.am b/Makefile.am index 811300004..dbfeffd92 100644 --- a/Makefile.am +++ b/Makefile.am @@ -3440,10 +3440,10 @@ EXTRA_DIST += \ src/core/settings/plugins/keyfile/tests/keyfiles/Test_New_Wireless_Group_Names \ src/core/settings/plugins/keyfile/tests/keyfiles/Test_minimal_1 \ src/core/settings/plugins/keyfile/tests/keyfiles/Test_minimal_2 \ - src/core/settings/plugins/keyfile/tests/keyfiles/Test_minimal_slave_1 \ - src/core/settings/plugins/keyfile/tests/keyfiles/Test_minimal_slave_2 \ - src/core/settings/plugins/keyfile/tests/keyfiles/Test_minimal_slave_3 \ - src/core/settings/plugins/keyfile/tests/keyfiles/Test_minimal_slave_4 \ + src/core/settings/plugins/keyfile/tests/keyfiles/Test_minimal_port_1 \ + src/core/settings/plugins/keyfile/tests/keyfiles/Test_minimal_port_2 \ + src/core/settings/plugins/keyfile/tests/keyfiles/Test_minimal_port_3 \ + src/core/settings/plugins/keyfile/tests/keyfiles/Test_minimal_port_4 \ src/core/settings/plugins/keyfile/tests/keyfiles/Test_Missing_Vlan_Setting \ src/core/settings/plugins/keyfile/tests/keyfiles/Test_Missing_Vlan_Flags \ src/core/settings/plugins/keyfile/tests/keyfiles/Test_Missing_ID_UUID \ @@ -3603,13 +3603,13 @@ EXTRA_DIST += \ src/core/settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-netmask-1.cexpected \ src/core/settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-random_wifi_connection.cexpected \ src/core/settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-random_wifi_connection_2.cexpected \ - src/core/settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-team-slave-enp31s0f1-142.cexpected \ + src/core/settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-team-port-enp31s0f1-142.cexpected \ src/core/settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-bond-eth-type \ src/core/settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-bond-main \ src/core/settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-bond-mode-numeric \ src/core/settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-bond-port \ - src/core/settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-bond-slave \ - src/core/settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-bond-slave-ib \ + src/core/settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-bond-port \ + src/core/settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-bond-port-ib \ src/core/settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-bridge-component \ src/core/settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-bridge-main \ src/core/settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-bridge-missing-stp \ diff --git a/man/NetworkManager.conf.xml b/man/NetworkManager.conf.xml index 3f29854d7..ed92ef5b8 100644 --- a/man/NetworkManager.conf.xml +++ b/man/NetworkManager.conf.xml @@ -1124,7 +1124,7 @@ ipv6.ip6-privacy=0 [connection] ipv6.ip6-privacy=0 -connection.autoconnect-slaves=1 +connection.autoconnect-ports=1 vpn.timeout=120 [connection-wifi-wlan0] diff --git a/man/nm-openvswitch.xml b/man/nm-openvswitch.xml index b89b63119..ff8521290 100644 --- a/man/nm-openvswitch.xml +++ b/man/nm-openvswitch.xml @@ -57,8 +57,8 @@ The configuration is made up of Bridges, Ports and - Interfaces. Interfaces are always enslaved to Ports, and Ports are always - enslaved to Bridges. + Interfaces. Interfaces are always attached to Ports, and Ports are always + attached to Bridges. NetworkManager only creates Bridges, Ports and Interfaces @@ -66,7 +66,7 @@ local interface nor its port automatically. - You can't enslave Interface directly to a Bridge. You + You can't attach Interface directly to a Bridge. You always need a Port, even if it has just one interface. @@ -89,7 +89,7 @@ type. Due to the limitations of OVSDB, "empty" Bridges (with no Ports) can't exist. NetworkManager inserts the records for Bridges into OVSDB when a Port is - enslaved. + attached. @@ -101,18 +101,18 @@ Due to the limitations of OVSDB, "empty" Ports (with no Interfaces) can't exist. Ports can also be configured to do VLAN tagging or Bonding. NetworkManager inserts the records for Ports into OVSDB when an Interface is - enslaved. Ports must be enslaved to a Bridge. + attached. Ports must be attached to a Bridge. Interfaces - Interfaces are represented by a connections enslaved to a Port. The + Interfaces are represented by a connections attached to a Port. The system interfaces (that have a corresponding Linux link) have a respective connection.type of the link (e.g. "wired", "bond", "dummy", etc.). Other interfaces ("internal" or "patch" interfaces) are of ovs-interface type. The OVSDB entries are - inserted upon enslavement to a Port. + inserted upon attachment to a Port. @@ -125,7 +125,7 @@ Connection 'ovs-bridge-bridge0' (d10fc64d-1d48-4394-a1b8-e1aea72f27d5) successfully added. $ nmcli conn add type ovs-port conn.interface port0 controller bridge0 Connection 'ovs-port-port0' (5ae22bae-bba4-4815-9ade-7e635633e1f0) successfully added. -$ nmcli conn add type ovs-interface slave-type ovs-port conn.interface iface0 \ +$ nmcli conn add type ovs-interface port-type ovs-port conn.interface iface0 \ controller port0 ipv4.method manual ipv4.address 192.0.2.1/24 Connection 'ovs-interface-iface0' (3640d2a1-a2fd-4718-92f1-cffadb5b6cdc) successfully added. diff --git a/man/nm-settings-ifcfg-rh.xsl b/man/nm-settings-ifcfg-rh.xsl index 8ad3b1082..790cd79cd 100644 --- a/man/nm-settings-ifcfg-rh.xsl +++ b/man/nm-settings-ifcfg-rh.xsl @@ -153,8 +153,8 @@ BOOTPROTO=dhcp Bonding configuration: -ifcfg-BOND: ifcfg-BOND-slave: -NAME=BOND NAME=BOND-slave +ifcfg-BOND: ifcfg-BOND-port: +NAME=BOND NAME=BOND-port UUID=b41888aa-924c-450c-b0f8-85a4f0a51b4a UUID=9bb048e4-286a-4cc3-b104-007dbd20decb DEVICE=bond100 DEVICE=eth0 BONDING_OPTS="mode=balance-rr miimon=100" ONBOOT=yes @@ -177,16 +177,16 @@ NAME=team0-profile UUID=1d3460a0-7b37-457f-a300-fe8d92da4807 ONBOOT=yes -ifcfg-my_team0_slave1: -NAME=team0-slave1 +ifcfg-my_team0_port1: +NAME=team0-port1 UUID=d5aed298-c567-4cc1-b808-6d38ecef9e64 DEVICE=eth1 ONBOOT=yes TEAM_MASTER=team0 DEVICETYPE=TeamPort -ifcfg-my_team0_slave2: -NAME=team0-slave2 +ifcfg-my_team0_port2: +NAME=team0-port2 UUID=94e75f4e-e5ad-401c-8962-31e0ae5d2215 DEVICE=eth2 ONBOOT=yes diff --git a/man/nm-settings-keyfile.xsl b/man/nm-settings-keyfile.xsl index 8f0c6d94f..90cb6268c 100644 --- a/man/nm-settings-keyfile.xsl +++ b/man/nm-settings-keyfile.xsl @@ -174,7 +174,7 @@ uuid=171ae855-a0ab-42b6-bd0c-60f5812eea9d uuid=d6e8ae98-71f8-4b3d-9d2d-2e2604 interface-name=MainBridge interface-name=em1 type=bridge type=ethernet controller=MainBridge -[bridge] slave-type=bridge +[bridge] port-type=bridge interface-name=MainBridge diff --git a/man/nmcli-examples.xml b/man/nmcli-examples.xml index 34dcff348..71ea5dc80 100644 --- a/man/nmcli-examples.xml +++ b/man/nmcli-examples.xml @@ -187,56 +187,56 @@ B,DISPATCH - Adding a bonding controller and two slave connection profiles + Adding a bonding controller and two port connection profiles $ nmcli con add type bond ifname mybond0 mode active-backup $ nmcli con add type ethernet ifname eth1 controller mybond0 $ nmcli con add type ethernet ifname eth2 controller mybond0 - This example demonstrates adding a bond controller connection and two slaves. The + This example demonstrates adding a bond controller connection and two ports. The first command adds a controller bond connection, naming the bonding interface mybond0 and using active-backup mode. - The next two commands add slaves connections, both enslaved to mybond0. - The first slave will be bound to eth1 interface, the second to + The next two commands add port connections, both attached as port to mybond0. + The first port will be bound to eth1 interface, the second to eth2. - Adding a team controller and two slave connection profiles + Adding a team controller and two port connection profiles $ nmcli con add type team con-name Team1 ifname Team1 config team1-controller-json.conf -$ nmcli con add type ethernet con-name Team1-slave1 ifname em1 controller Team1 -$ nmcli con add type ethernet con-name Team1-slave2 ifname em2 controller Team1 +$ nmcli con add type ethernet con-name Team1-port1 ifname em1 controller Team1 +$ nmcli con add type ethernet con-name Team1-port2 ifname em2 controller Team1 - This example demonstrates adding a team controller connection profile and two slaves. It is + This example demonstrates adding a team controller connection profile and two ports. It is very similar to the bonding example. The first command adds a controller team profile, naming the team interface and the profile Team1. The team configuration for the controller is read from team1-controller-json.conf file. Later, you can change the configuration with modify command (nmcli con modify Team1 team.config team1-controller-another-json.conf). - The last two commands add slaves profiles, both enslaved to Team1. - The first slave will be bound to the em1 interface, the second to - em2. The slaves don't specify config and thus + The last two commands add port profiles, both attached as port to Team1. + The first port will be bound to the em1 interface, the second to + em2. The ports don't specify config and thus teamd will use its default configuration. You will activate the whole setup - by activating both slaves: - $ nmcli con up Team1-slave1 - $ nmcli con up Team1-slave2 + by activating both ports: + $ nmcli con up Team1-port1 + $ nmcli con up Team1-port2 By default, the created profiles are marked for auto-activation. But if another connection has been activated on the device, the new profile won't activate automatically and you need to activate it manually. - Adding a bridge and two slave profiles + Adding a bridge and two port profiles $ nmcli con add type bridge con-name TowerBridge ifname TowerBridge -$ nmcli con add type ethernet con-name br-slave-1 ifname ens3 controller TowerBridge -$ nmcli con add type ethernet con-name br-slave-2 ifname ens4 controller TowerBridge +$ nmcli con add type ethernet con-name br-port-1 ifname ens3 controller TowerBridge +$ nmcli con add type ethernet con-name br-port-2 ifname ens4 controller TowerBridge $ nmcli con modify TowerBridge bridge.stp no - This example demonstrates adding a bridge controller connection and two slaves. The + This example demonstrates adding a bridge controller connection and two ports. The first command adds a controller bridge connection, naming the bridge interface and the profile as TowerBridge. - The next two commands add slaves profiles, both will be enslaved to + The next two commands add ports profiles, both will be attached as port to TowerBridge. - The first slave will be tied to ens3 interface, the second to + The first port will be tied to ens3 interface, the second to ens4. The last command will disable 802.1D STP for the TowerBridge profile. @@ -376,7 +376,7 @@ connection.read-only: no connection.permissions: connection.zone: -- connection.controller: -- -connection.slave-type: -- +connection.port-type: -- connection.secondaries: connection.gateway-ping-timeout: 0 --------------------------------------------------------------------------- @@ -466,7 +466,7 @@ connection.read-only: no connection.permissions: connection.zone: -- connection.controller: -- -connection.slave-type: -- +connection.port-type: -- connection.secondaries: connection.gateway-ping-timeout: 0 --------------------------------------------------------------------------- @@ -526,7 +526,7 @@ connection.read-only: no connection.permissions: connection.zone: -- connection.controller: -- -connection.slave-type: -- +connection.port-type: -- connection.secondaries: connection.gateway-ping-timeout: 0 --------------------------------------------------------------------------- diff --git a/src/core/devices/nm-device-bond.c b/src/core/devices/nm-device-bond.c index 91e0cb2d5..06a02d1a7 100644 --- a/src/core/devices/nm-device-bond.c +++ b/src/core/devices/nm-device-bond.c @@ -663,7 +663,7 @@ commit_port_options(NMDevice *bond_device, NMDevice *port, NMSettingBondPort *s_ * one of those modes, don't try to set the priority explicitly to zero. */ prio_has = FALSE; } else if (nm_platform_kernel_support_get_full( - NM_PLATFORM_KERNEL_SUPPORT_TYPE_IFLA_BOND_SLAVE_PRIO, + NM_PLATFORM_KERNEL_SUPPORT_TYPE_IFLA_BOND_PORT_PRIO, FALSE) == NM_OPTION_BOOL_TRUE) { /* We can only detect support if we have it. We cannot detect lack of support if @@ -703,15 +703,15 @@ attach_port(NMDevice *device, NMDeviceBond *self = NM_DEVICE_BOND(device); NMSettingBondPort *s_port; - nm_device_controller_check_slave_physical_port(device, port, LOGD_BOND); + nm_device_controller_check_port_physical_port(device, port, LOGD_BOND); if (configure) { gboolean success; nm_device_take_down(port, TRUE); - success = nm_platform_link_enslave(nm_device_get_platform(device), - nm_device_get_ip_ifindex(device), - nm_device_get_ip_ifindex(port)); + success = nm_platform_link_attach_port(nm_device_get_platform(device), + nm_device_get_ip_ifindex(device), + nm_device_get_ip_ifindex(port)); nm_device_bring_up(port); if (!success) { @@ -741,7 +741,7 @@ detach_port(NMDevice *device, NMDeviceBond *self = NM_DEVICE_BOND(device); gboolean success; gs_free char *address = NULL; - int ifindex_slave; + int ifindex_port; int ifindex; if (configure) { @@ -750,9 +750,9 @@ detach_port(NMDevice *device, configure = FALSE; } - ifindex_slave = nm_device_get_ip_ifindex(port); + ifindex_port = nm_device_get_ip_ifindex(port); - if (ifindex_slave <= 0) + if (ifindex_port <= 0) _LOGD(LOGD_BOND, "bond port %s is already detached", nm_device_get_ip_iface(port)); if (configure) { @@ -762,10 +762,10 @@ detach_port(NMDevice *device, address = g_strdup(nm_device_get_hw_address(device)); - if (ifindex_slave > 0) { - success = nm_platform_link_release(nm_device_get_platform(device), - nm_device_get_ip_ifindex(device), - ifindex_slave); + if (ifindex_port > 0) { + success = nm_platform_link_release_port(nm_device_get_platform(device), + nm_device_get_ip_ifindex(device), + ifindex_port); if (success) { _LOGI(LOGD_BOND, "detached bond port %s", nm_device_get_ip_iface(port)); @@ -777,7 +777,7 @@ detach_port(NMDevice *device, if ((applied = nm_device_get_applied_connection(device)) && ((s_wired = nm_connection_get_setting_wired(applied))) && ((cloned_mac = nm_setting_wired_get_cloned_mac_address(s_wired)))) { - /* When the last slave is released the bond MAC will be set to a random + /* When the last port is released the bond MAC will be set to a random * value by kernel; if we have set a cloned-mac-address, we need to * restore it to the previous value. */ nm_platform_process_events(nm_device_get_platform(device)); @@ -785,16 +785,16 @@ detach_port(NMDevice *device, nm_device_hw_addr_set(device, address, "restore", FALSE); } - /* Kernel bonding code "closes" the slave when releasing it, (which clears + /* Kernel bonding code "closes" the port when releasing it, (which clears * IFF_UP), so we must bring it back up here to ensure carrier changes and - * other state is noticed by the now-released slave. + * other state is noticed by the now-released port. */ - if (ifindex_slave > 0) { + if (ifindex_port > 0) { if (!nm_device_bring_up(port)) _LOGW(LOGD_BOND, "detached bond port could not be brought up."); } } else { - if (ifindex_slave > 0) { + if (ifindex_port > 0) { _LOGI(LOGD_BOND, "bond port %s was detached", nm_device_get_ip_iface(port)); } } @@ -966,8 +966,8 @@ nm_device_bond_class_init(NMDeviceBondClass *klass) device_class->get_generic_capabilities = get_generic_capabilities; device_class->complete_connection = complete_connection; - device_class->update_connection = update_connection; - device_class->controller_update_slave_connection = controller_update_port_connection; + device_class->update_connection = update_connection; + device_class->controller_update_port_connection = controller_update_port_connection; device_class->create_and_realize = create_and_realize; device_class->act_stage1_prepare = act_stage1_prepare; diff --git a/src/core/devices/nm-device-bridge.c b/src/core/devices/nm-device-bridge.c index c31e9d11a..b256056d4 100644 --- a/src/core/devices/nm-device-bridge.c +++ b/src/core/devices/nm-device-bridge.c @@ -575,22 +575,22 @@ out: } static gboolean -controller_update_slave_connection(NMDevice *device, - NMDevice *slave, - NMConnection *connection, - GError **error) +controller_update_port_connection(NMDevice *device, + NMDevice *port, + NMConnection *connection, + GError **error) { NMSettingConnection *s_con; NMSettingBridgePort *s_port; - int ifindex_slave = nm_device_get_ifindex(slave); + int ifindex_port = nm_device_get_ifindex(port); NMConnection *applied_connection = nm_device_get_applied_connection(device); const NMPlatformLink *pllink; - g_return_val_if_fail(ifindex_slave > 0, FALSE); + g_return_val_if_fail(ifindex_port > 0, FALSE); s_con = nm_connection_get_setting_connection(connection); s_port = _nm_connection_ensure_setting(connection, NM_TYPE_SETTING_BRIDGE_PORT); - pllink = nm_platform_link_get(nm_device_get_platform(slave), ifindex_slave); + pllink = nm_platform_link_get(nm_device_get_platform(port), ifindex_port); if (pllink && pllink->port_kind == NM_PORT_KIND_BRIDGE) { g_object_set(s_port, @@ -922,9 +922,9 @@ attach_port(NMDevice *device, NMSettingBridgePort *s_port; if (configure) { - if (!nm_platform_link_enslave(nm_device_get_platform(device), - nm_device_get_ip_ifindex(device), - nm_device_get_ip_ifindex(port))) + if (!nm_platform_link_attach_port(nm_device_get_platform(device), + nm_device_get_ip_ifindex(device), + nm_device_get_ip_ifindex(port))) return FALSE; controller_connection = nm_device_get_applied_connection(device); @@ -945,7 +945,7 @@ attach_port(NMDevice *device, plat_vlans = setting_vlans_to_platform(vlans); - /* Since the link was just enslaved, there are no existing VLANs + /* Since the link was just enportd, there are no existing VLANs * (except for the default one) and so there's no need to flush. */ if (plat_vlans @@ -976,7 +976,7 @@ detach_port(NMDevice *device, { NMDeviceBridge *self = NM_DEVICE_BRIDGE(device); gboolean success; - int ifindex_slave; + int ifindex_port; int ifindex; if (configure) { @@ -985,17 +985,17 @@ detach_port(NMDevice *device, configure = FALSE; } - ifindex_slave = nm_device_get_ip_ifindex(port); + ifindex_port = nm_device_get_ip_ifindex(port); - if (ifindex_slave <= 0) { + if (ifindex_port <= 0) { _LOGD(LOGD_TEAM, "bridge port %s is already detached", nm_device_get_ip_iface(port)); return TRUE; } if (configure) { - success = nm_platform_link_release(nm_device_get_platform(device), - nm_device_get_ip_ifindex(device), - ifindex_slave); + success = nm_platform_link_release_port(nm_device_get_platform(device), + nm_device_get_ip_ifindex(device), + ifindex_port); if (success) { _LOGI(LOGD_BRIDGE, "detached bridge port %s", nm_device_get_ip_iface(port)); @@ -1061,7 +1061,7 @@ create_and_realize(NMDevice *device, mtu = nm_setting_wired_get_mtu(s_wired); /* If mtu != 0, we set the MTU of the new bridge at creation time. However, kernel will still - * automatically adjust the MTU of the bridge based on the minimum of the slave's MTU. + * automatically adjust the MTU of the bridge based on the minimum of the port's MTU. * We don't want this automatism as the user asked for a fixed MTU. * * To workaround this behavior of kernel, we will later toggle the MTU twice. See @@ -1199,8 +1199,8 @@ nm_device_bridge_class_init(NMDeviceBridgeClass *klass) device_class->check_connection_available = check_connection_available; device_class->complete_connection = complete_connection; - device_class->update_connection = update_connection; - device_class->controller_update_slave_connection = controller_update_slave_connection; + device_class->update_connection = update_connection; + device_class->controller_update_port_connection = controller_update_port_connection; device_class->create_and_realize = create_and_realize; device_class->act_stage1_prepare_set_hwaddr_ethernet = TRUE; diff --git a/src/core/devices/nm-device-private.h b/src/core/devices/nm-device-private.h index 1829694d4..3bf5925cf 100644 --- a/src/core/devices/nm-device-private.h +++ b/src/core/devices/nm-device-private.h @@ -58,11 +58,11 @@ void nm_device_activate_schedule_stage3_ip_config(NMDevice *device, gboolean do_ void nm_device_recheck_available_connections(NMDevice *device); -void nm_device_controller_check_slave_physical_port(NMDevice *self, - NMDevice *slave, - NMLogDomain log_domain); +void nm_device_controller_check_port_physical_port(NMDevice *self, + NMDevice *port, + NMLogDomain log_domain); -void nm_device_controller_release_slaves_all(NMDevice *self); +void nm_device_controller_release_ports_all(NMDevice *self); void nm_device_set_carrier(NMDevice *self, gboolean carrier); diff --git a/src/core/devices/nm-device-vrf.c b/src/core/devices/nm-device-vrf.c index c7f32e236..c3d313470 100644 --- a/src/core/devices/nm-device-vrf.c +++ b/src/core/devices/nm-device-vrf.c @@ -222,13 +222,13 @@ attach_port(NMDevice *device, gboolean success = TRUE; const char *port_iface = nm_device_get_ip_iface(port); - nm_device_controller_check_slave_physical_port(device, port, LOGD_DEVICE); + nm_device_controller_check_port_physical_port(device, port, LOGD_DEVICE); if (configure) { nm_device_take_down(port, TRUE); - success = nm_platform_link_enslave(nm_device_get_platform(device), - nm_device_get_ip_ifindex(device), - nm_device_get_ip_ifindex(port)); + success = nm_platform_link_attach_port(nm_device_get_platform(device), + nm_device_get_ip_ifindex(device), + nm_device_get_ip_ifindex(port)); nm_device_bring_up(port); if (!success) @@ -267,9 +267,9 @@ detach_port(NMDevice *device, if (configure) { if (ifindex_port > 0) { - success = nm_platform_link_release(nm_device_get_platform(device), - nm_device_get_ip_ifindex(device), - ifindex_port); + success = nm_platform_link_release_port(nm_device_get_platform(device), + nm_device_get_ip_ifindex(device), + ifindex_port); if (success) { _LOGI(LOGD_DEVICE, "detached VRF port %s", nm_device_get_ip_iface(port)); diff --git a/src/core/devices/nm-device.c b/src/core/devices/nm-device.c index 2a5364a85..1f094e3ae 100644 --- a/src/core/devices/nm-device.c +++ b/src/core/devices/nm-device.c @@ -107,10 +107,10 @@ typedef void (*ActivationHandleFunc)(NMDevice *self); typedef enum { - RELEASE_SLAVE_TYPE_NO_CONFIG, - RELEASE_SLAVE_TYPE_CONFIG, - RELEASE_SLAVE_TYPE_CONFIG_FORCE, -} ReleaseSlaveType; + RELEASE_PORT_TYPE_NO_CONFIG, + RELEASE_PORT_TYPE_CONFIG, + RELEASE_PORT_TYPE_CONFIG_FORCE, +} ReleasePortType; typedef enum { CLEANUP_TYPE_KEEP, @@ -127,13 +127,13 @@ typedef enum _nm_packed { } AddrMethodState; typedef struct { - CList lst_slave; - NMDevice *slave; + CList lst_port; + NMDevice *port; GCancellable *cancellable; gulong watch_id; - bool slave_is_enslaved; + bool port_is_attached; bool configure; -} SlaveInfo; +} PortInfo; typedef struct { NMDevice *device; @@ -592,7 +592,7 @@ typedef struct _NMDevicePrivate { NMDeviceAutoconnectBlockedFlags autoconnect_blocked_flags : 5; - bool is_enslaved : 1; + bool is_attached : 1; bool device_link_changed_down : 1; @@ -710,13 +710,13 @@ typedef struct _NMDevicePrivate { NMPlatformLinkChangeFlags flags; } link_props_state; - /* controller interface for bridge/bond/team slave */ + /* controller interface for bridge/bond/team port */ NMDevice *controller; gulong controller_ready_id; int controller_ifindex; - /* slave management */ - CList slaves; /* list of SlaveInfo */ + /* port management */ + CList ports; /* list of PortInfo */ NMMetered metered; @@ -789,11 +789,11 @@ static void _dev_l3_cfg_commit(NMDevice *self, gboolean do_sync); static void _dev_l3_cfg_commit_type_reset(NMDevice *self); -static gboolean nm_device_controller_add_slave(NMDevice *self, NMDevice *slave, gboolean configure); -static void nm_device_slave_notify_enslave(NMDevice *self, gboolean success); -static void nm_device_slave_notify_release(NMDevice *self, - NMDeviceStateReason reason, - ReleaseSlaveType release_type); +static gboolean nm_device_controller_add_port(NMDevice *self, NMDevice *port, gboolean configure); +static void nm_device_port_notify_attach_as_port(NMDevice *self, gboolean success); +static void nm_device_port_notify_release(NMDevice *self, + NMDeviceStateReason reason, + ReleasePortType release_type); static void _dev_ipll6_start(NMDevice *self); @@ -3834,9 +3834,9 @@ _dev_ip_state_check(NMDevice *self, int addr_family) if (priv->ip_data_x[IS_IPv4].state == NM_DEVICE_IP_STATE_PENDING && nm_active_connection_get_controller(NM_ACTIVE_CONNECTION(priv->act_request.obj)) - && !priv->is_enslaved) { + && !priv->is_attached) { /* Don't progress into IP_CHECK or SECONDARIES if we're waiting for the - * controller to enslave us. */ + * controller to attach as port us. */ ip_state = NM_DEVICE_IP_STATE_PENDING; goto got_ip_state; } @@ -5683,9 +5683,9 @@ nm_device_get_route_metric(NMDevice *self, int addr_family) if (connection) { s_ip = nm_connection_get_setting_ip_config(connection, addr_family); - /* Slave interfaces don't have IP settings, but we may get here when + /* Port interfaces don't have IP settings, but we may get here when * external changes are made or when noticing IP changes when starting - * the slave connection. + * the port connection. */ if (s_ip) { route_metric = nm_setting_ip_config_get_route_metric(s_ip); @@ -6671,43 +6671,43 @@ nm_device_get_connectivity_state(NMDevice *self, int addr_family) /*****************************************************************************/ -static SlaveInfo * -find_slave_info(NMDevice *self, NMDevice *slave) +static PortInfo * +find_port_info(NMDevice *self, NMDevice *port) { NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE(self); - SlaveInfo *info; + PortInfo *info; - c_list_for_each_entry (info, &priv->slaves, lst_slave) { - if (info->slave == slave) + c_list_for_each_entry (info, &priv->ports, lst_port) { + if (info->port == port) return info; } return NULL; } static void -attach_port_done(NMDevice *self, NMDevice *slave, gboolean success) +attach_port_done(NMDevice *self, NMDevice *port, gboolean success) { - SlaveInfo *info; + PortInfo *info; - info = find_slave_info(self, slave); + info = find_port_info(self, port); if (!info) return; - info->slave_is_enslaved = success; + info->port_is_attached = success; - nm_device_slave_notify_enslave(info->slave, success); + nm_device_port_notify_attach_as_port(info->port, success); /* Ensure the device's hardware address is up-to-date; it often changes - * when slaves change. + * when ports change. */ nm_device_update_hw_address(self); - /* Since slave devices don't have their own IP configuration, + /* Since port devices don't have their own IP configuration, * set the MTU here. */ - _commit_mtu(slave); + _commit_mtu(port); - /* Restart IP configuration if we're waiting for slaves. Do this + /* Restart IP configuration if we're waiting for ports. Do this * after updating the hardware address as IP config may need the * new address. */ @@ -6718,181 +6718,181 @@ attach_port_done(NMDevice *self, NMDevice *slave, gboolean success) static void attach_port_cb(NMDevice *self, GError *error, gpointer user_data) { - NMDevice *slave = user_data; - SlaveInfo *info; + NMDevice *port = user_data; + PortInfo *info; if (nm_utils_error_is_cancelled(error)) return; - info = find_slave_info(self, slave); + info = find_port_info(self, port); if (!info) return; nm_clear_g_cancellable(&info->cancellable); - attach_port_done(self, slave, !error); + attach_port_done(self, port, !error); } /** - * nm_device_controller_enslave_slave: + * nm_device_controller_attach_port: * @self: the controller device - * @slave: the slave device to enslave - * @connection: (nullable): the slave device's connection + * @port: the port device to attach as port + * @connection: (nullable): the port device's connection * * If @self is capable of enslaving other devices (ie it's a bridge, bond, team, - * etc) then this function enslaves @slave. + * etc) then this function attach @port. */ static void -nm_device_controller_enslave_slave(NMDevice *self, NMDevice *slave, NMConnection *connection) +nm_device_controller_attach_port(NMDevice *self, NMDevice *port, NMConnection *connection) { - SlaveInfo *info; - NMTernary success; - gboolean configure; + PortInfo *info; + NMTernary success; + gboolean configure; g_return_if_fail(self); - g_return_if_fail(slave); + g_return_if_fail(port); g_return_if_fail(NM_DEVICE_GET_CLASS(self)->attach_port); - info = find_slave_info(self, slave); + info = find_port_info(self, port); if (!info) return; - if (info->slave_is_enslaved) + if (info->port_is_attached) success = TRUE; else { configure = (info->configure && connection != NULL); if (configure) - g_return_if_fail(nm_device_get_state(slave) >= NM_DEVICE_STATE_DISCONNECTED); + g_return_if_fail(nm_device_get_state(port) >= NM_DEVICE_STATE_DISCONNECTED); nm_clear_g_cancellable(&info->cancellable); info->cancellable = g_cancellable_new(); success = NM_DEVICE_GET_CLASS(self)->attach_port(self, - slave, + port, connection, configure, info->cancellable, attach_port_cb, - slave); + port); if (success == NM_TERNARY_DEFAULT) return; } - attach_port_done(self, slave, success); + attach_port_done(self, port, success); } static void detach_port_cb(NMDevice *self, GError *error, gpointer user_data) { - nm_auto_unref_object NMDevice *slave = user_data; - NMDevicePrivate *port_priv = NM_DEVICE_GET_PRIVATE(slave); + nm_auto_unref_object NMDevice *port = user_data; + NMDevicePrivate *port_priv = NM_DEVICE_GET_PRIVATE(port); nm_assert(port_priv->port_detach_count > 0); if (--port_priv->port_detach_count == 0) { if (port_priv->state == NM_DEVICE_STATE_DEACTIVATING) { - deactivate_ready(slave, port_priv->port_detach_reason); + deactivate_ready(port, port_priv->port_detach_reason); } } } /** - * nm_device_controller_release_slave: + * nm_device_controller_release_port: * @self: the controller device - * @slave: the slave device to release - * @configure: whether @self needs to actually release @slave - * @release_type: whether @self needs to actually release slave + * @port: the port device to release + * @configure: whether @self needs to actually release @port + * @release_type: whether @self needs to actually release port * and whether that is forced. - * @reason: the state change reason for the @slave + * @reason: the state change reason for the @port * * If @self is capable of enslaving other devices (ie it's a bridge, bond, team, - * etc) then this function releases the previously enslaved @slave and/or - * updates the state of @self and @slave to reflect its release. + * etc) then this function releases the previously attached @port and/or + * updates the state of @self and @port to reflect its release. */ static void -nm_device_controller_release_slave(NMDevice *self, - NMDevice *slave, - ReleaseSlaveType release_type, - NMDeviceStateReason reason) +nm_device_controller_release_port(NMDevice *self, + NMDevice *port, + ReleasePortType release_type, + NMDeviceStateReason reason) { NMDevicePrivate *priv; NMDevicePrivate *port_priv; - SlaveInfo *info; - gs_unref_object NMDevice *self_free = NULL; - gs_unref_object NMDevice *slave_free = NULL; + PortInfo *info; + gs_unref_object NMDevice *self_free = NULL; + gs_unref_object NMDevice *port_free = NULL; g_return_if_fail(NM_DEVICE(self)); - g_return_if_fail(NM_DEVICE(slave)); + g_return_if_fail(NM_DEVICE(port)); nm_assert(NM_IN_SET(release_type, - RELEASE_SLAVE_TYPE_NO_CONFIG, - RELEASE_SLAVE_TYPE_CONFIG, - RELEASE_SLAVE_TYPE_CONFIG_FORCE)); + RELEASE_PORT_TYPE_NO_CONFIG, + RELEASE_PORT_TYPE_CONFIG, + RELEASE_PORT_TYPE_CONFIG_FORCE)); g_return_if_fail(NM_DEVICE_GET_CLASS(self)->detach_port != NULL); - info = find_slave_info(self, slave); + info = find_port_info(self, port); _LOGT(LOGD_CORE, - "controller: release one slave " NM_HASH_OBFUSCATE_PTR_FMT "/%s %s%s", - NM_HASH_OBFUSCATE_PTR(slave), - nm_device_get_iface(slave), - !info ? "(not registered)" : (info->slave_is_enslaved ? "(enslaved)" : "(not enslaved)"), - release_type == RELEASE_SLAVE_TYPE_CONFIG_FORCE + "controller: release one port " NM_HASH_OBFUSCATE_PTR_FMT "/%s %s%s", + NM_HASH_OBFUSCATE_PTR(port), + nm_device_get_iface(port), + !info ? "(not registered)" : (info->port_is_attached ? "(attached)" : "(not attached)"), + release_type == RELEASE_PORT_TYPE_CONFIG_FORCE ? " (force-configure)" - : (release_type == RELEASE_SLAVE_TYPE_CONFIG ? " (configure)" : "(no-config)")); + : (release_type == RELEASE_PORT_TYPE_CONFIG ? " (configure)" : "(no-config)")); if (!info) g_return_if_reached(); priv = NM_DEVICE_GET_PRIVATE(self); - port_priv = NM_DEVICE_GET_PRIVATE(slave); + port_priv = NM_DEVICE_GET_PRIVATE(port); g_return_if_fail(self == port_priv->controller); - nm_assert(slave == info->slave); + nm_assert(port == info->port); nm_clear_g_cancellable(&info->cancellable); /* first, let subclasses handle the release ... */ - if (info->slave_is_enslaved || nm_device_sys_iface_state_is_external(slave) - || release_type >= RELEASE_SLAVE_TYPE_CONFIG_FORCE) { + if (info->port_is_attached || nm_device_sys_iface_state_is_external(port) + || release_type >= RELEASE_PORT_TYPE_CONFIG_FORCE) { NMTernary ret; ret = NM_DEVICE_GET_CLASS(self)->detach_port(self, - slave, - release_type >= RELEASE_SLAVE_TYPE_CONFIG, + port, + release_type >= RELEASE_PORT_TYPE_CONFIG, NULL, detach_port_cb, - g_object_ref(slave)); + g_object_ref(port)); if (ret == NM_TERNARY_DEFAULT) { port_priv->port_detach_count++; port_priv->port_detach_reason = reason; } } - /* raise notifications about the release, including clearing is_enslaved. */ - nm_device_slave_notify_release(slave, reason, release_type); + /* raise notifications about the release, including clearing is_attached. */ + nm_device_port_notify_release(port, reason, release_type); /* keep both alive until the end of the function. * Transfers ownership from port_priv->controller. */ nm_assert(self == port_priv->controller); self_free = g_steal_pointer(&port_priv->controller); - nm_assert(slave == info->slave); - slave_free = g_steal_pointer(&info->slave); + nm_assert(port == info->port); + port_free = g_steal_pointer(&info->port); - c_list_unlink(&info->lst_slave); - g_signal_handler_disconnect(slave, info->watch_id); + c_list_unlink(&info->lst_port); + g_signal_handler_disconnect(port, info->watch_id); nm_g_slice_free(info); - if (c_list_is_empty(&priv->slaves)) { + if (c_list_is_empty(&priv->ports)) { _active_connection_set_state_flags_full(self, 0, NM_ACTIVATION_STATE_FLAG_MASTER_HAS_SLAVES); } /* Ensure the device's hardware address is up-to-date; it often changes - * when slaves change. + * when ports change. */ nm_device_update_hw_address(self); - nm_device_set_unmanaged_by_flags(slave, - NM_UNMANAGED_IS_SLAVE, + nm_device_set_unmanaged_by_flags(port, + NM_UNMANAGED_IS_PORT, NM_UNMAN_FLAG_OP_FORGET, NM_DEVICE_STATE_REASON_REMOVED); } @@ -6922,7 +6922,7 @@ _dev_unmanaged_is_external_down(NMDevice *self, gboolean consider_can) /* Manage externally-created software interfaces only when they are IFF_UP */ if (priv->ifindex <= 0 || !priv->up - || !(!c_list_is_empty(&priv->slaves) + || !(!c_list_is_empty(&priv->ports) || nm_platform_link_can_assume(nm_device_get_platform(self), priv->ifindex))) return NM_UNMAN_FLAG_OP_SET_UNMANAGED; @@ -7017,8 +7017,8 @@ carrier_changed(NMDevice *self, gboolean carrier) return; } /* fall-through and change state of device */ - } else if (priv->is_enslaved && !carrier) { - /* Slaves don't deactivate when they lose carrier; for + } else if (priv->is_attached && !carrier) { + /* Ports don't deactivate when they lose carrier; for * bonds/teams in particular that would be actively * counterproductive. */ @@ -7162,7 +7162,7 @@ nm_device_set_carrier_from_platform(NMDevice *self) /*****************************************************************************/ static void -device_recheck_slave_status(NMDevice *self, const NMPlatformLink *plink) +device_recheck_port_status(NMDevice *self, const NMPlatformLink *plink) { NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE(self); NMDevice *controller; @@ -7193,24 +7193,24 @@ device_recheck_slave_status(NMDevice *self, const NMPlatformLink *plink) if (priv->controller) { if (plink->controller > 0 && plink->controller == nm_device_get_ifindex(priv->controller)) { - /* call add-slave again. We expect @self already to be added to + /* call add-port again. We expect @self already to be added to * the controller, but this also triggers a recheck-assume. */ - nm_device_controller_add_slave(priv->controller, self, FALSE); + nm_device_controller_add_port(priv->controller, self, FALSE); goto out; } - nm_device_controller_release_slave(priv->controller, - self, - RELEASE_SLAVE_TYPE_NO_CONFIG, - NM_DEVICE_STATE_REASON_CONNECTION_ASSUMED); + nm_device_controller_release_port(priv->controller, + self, + RELEASE_PORT_TYPE_NO_CONFIG, + NM_DEVICE_STATE_REASON_CONNECTION_ASSUMED); } if (controller) { if (NM_DEVICE_GET_CLASS(controller)->attach_port) { - nm_device_controller_add_slave(controller, self, FALSE); + nm_device_controller_add_port(controller, self, FALSE); } else { _LOGD(LOGD_DEVICE, - "enslaved to non-controller-type device %s; ignoring", + "attached to non-controller-type device %s; ignoring", nm_device_get_iface(controller)); } goto out; @@ -7218,7 +7218,7 @@ device_recheck_slave_status(NMDevice *self, const NMPlatformLink *plink) if (plink->controller) { _LOGD(LOGD_DEVICE, - "enslaved to unknown device %d (%s%s%s)", + "attached to unknown device %d (%s%s%s)", plink->controller, NM_PRINT_FMT_QUOTED(plink_controller, "\"", plink_controller->name, "\"", "??")); if (!priv->ifindex_changed_id) { @@ -7436,7 +7436,7 @@ device_link_changed(gpointer user_data) _dev_unmanaged_check_external_down(self, FALSE, FALSE); - device_recheck_slave_status(self, pllink); + device_recheck_port_status(self, pllink); if (priv->up && (!was_up || seen_down)) { /* the link was down and just came up. That happens for example, while changing MTU. @@ -7988,7 +7988,7 @@ realize_start_notify(NMDevice *self, const NMPlatformLink *pllink) * Update the device from backing resource properties (like hardware * addresses, carrier states, driver/firmware info, etc). This function * should only change properties for this device, and should not perform - * any tasks that affect other interfaces (like controller/slave or parent/child + * any tasks that affect other interfaces (like controller/port or parent/child * stuff). */ static void @@ -8140,7 +8140,7 @@ realize_start_setup(NMDevice *self, * @self: the #NMDevice * @plink: the #NMPlatformLink if backed by a kernel netdevice * - * Update the device's controller/slave or parent/child relationships from + * Update the device's controller/port or parent/child relationships from * backing resource properties. After this function finishes, the device * is ready for network connectivity. */ @@ -8157,7 +8157,7 @@ nm_device_realize_finish(NMDevice *self, const NMPlatformLink *plink) g_return_if_fail(!priv->real); if (plink) - device_recheck_slave_status(self, plink); + device_recheck_port_status(self, plink); priv->real = TRUE; _notify(self, PROP_REAL); @@ -8317,7 +8317,7 @@ nm_device_unrealize(NMDevice *self, gboolean remove_resources, GError **error) nm_device_set_unmanaged_flags(self, NM_UNMANAGED_USER_UDEV | NM_UNMANAGED_USER_EXPLICIT - | NM_UNMANAGED_EXTERNAL_DOWN | NM_UNMANAGED_IS_SLAVE, + | NM_UNMANAGED_EXTERNAL_DOWN | NM_UNMANAGED_IS_PORT, NM_UNMAN_FLAG_OP_FORGET); nm_device_state_changed(self, @@ -8436,117 +8436,117 @@ nm_device_new_default_connection(NMDevice *self) } static void -slave_state_changed(NMDevice *slave, - NMDeviceState slave_new_state, - NMDeviceState slave_old_state, - NMDeviceStateReason reason, - NMDevice *self) +port_state_changed(NMDevice *port, + NMDeviceState port_new_state, + NMDeviceState port_old_state, + NMDeviceStateReason reason, + NMDevice *self) { NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE(self); gboolean release = FALSE; gboolean configure; _LOGD(LOGD_DEVICE, - "slave %s state change %d (%s) -> %d (%s)", - nm_device_get_iface(slave), - slave_old_state, - nm_device_state_to_string(slave_old_state), - slave_new_state, - nm_device_state_to_string(slave_new_state)); + "port %s state change %d (%s) -> %d (%s)", + nm_device_get_iface(port), + port_old_state, + nm_device_state_to_string(port_old_state), + port_new_state, + nm_device_state_to_string(port_new_state)); - /* Don't try to enslave slaves until the controller is ready */ + /* Don't try to attach ports until the controller is ready */ if (priv->state < NM_DEVICE_STATE_CONFIG) return; - if (slave_new_state == NM_DEVICE_STATE_IP_CONFIG) - nm_device_controller_enslave_slave(self, slave, nm_device_get_applied_connection(slave)); - else if (slave_new_state > NM_DEVICE_STATE_ACTIVATED) + if (port_new_state == NM_DEVICE_STATE_IP_CONFIG) + nm_device_controller_attach_port(self, port, nm_device_get_applied_connection(port)); + else if (port_new_state > NM_DEVICE_STATE_ACTIVATED) release = TRUE; - else if (slave_new_state <= NM_DEVICE_STATE_DISCONNECTED - && slave_old_state > NM_DEVICE_STATE_DISCONNECTED) { + else if (port_new_state <= NM_DEVICE_STATE_DISCONNECTED + && port_old_state > NM_DEVICE_STATE_DISCONNECTED) { /* Catch failures due to unavailable or unmanaged */ release = TRUE; } if (release) { configure = (priv->sys_iface_state == NM_DEVICE_SYS_IFACE_STATE_MANAGED - && nm_device_sys_iface_state_get(slave) != NM_DEVICE_SYS_IFACE_STATE_EXTERNAL) - || nm_device_sys_iface_state_get(slave) == NM_DEVICE_SYS_IFACE_STATE_MANAGED; + && nm_device_sys_iface_state_get(port) != NM_DEVICE_SYS_IFACE_STATE_EXTERNAL) + || nm_device_sys_iface_state_get(port) == NM_DEVICE_SYS_IFACE_STATE_MANAGED; - nm_device_controller_release_slave(self, - slave, - configure ? RELEASE_SLAVE_TYPE_CONFIG - : RELEASE_SLAVE_TYPE_NO_CONFIG, - reason); + nm_device_controller_release_port(self, + port, + configure ? RELEASE_PORT_TYPE_CONFIG + : RELEASE_PORT_TYPE_NO_CONFIG, + reason); /* Bridge/bond/team interfaces are left up until manually deactivated */ - if (c_list_is_empty(&priv->slaves) && priv->state == NM_DEVICE_STATE_ACTIVATED) - _LOGD(LOGD_DEVICE, "last slave removed; remaining activated"); + if (c_list_is_empty(&priv->ports) && priv->state == NM_DEVICE_STATE_ACTIVATED) + _LOGD(LOGD_DEVICE, "last port removed; remaining activated"); } } /** - * nm_device_controller_add_slave: + * nm_device_controller_add_port: * @self: the controller device - * @slave: the slave device to enslave - * @configure: pass %TRUE if the slave should be configured by the controller, or + * @port: the port device to attach as port + * @configure: pass %TRUE if the port should be configured by the controller, or * %FALSE if it is already configured outside NetworkManager * * If @self is capable of enslaving other devices (ie it's a bridge, bond, team, - * etc) then this function adds @slave to the slave list for later enslavement. + * etc) then this function adds @port to the port list for later attachment as port. * - * Returns: %TRUE if the slave was enslaved. %FALSE means, the slave was already - * enslaved and nothing was done. + * Returns: %TRUE if the port was attached. %FALSE means, the port was already + * attached and nothing was done. */ static gboolean -nm_device_controller_add_slave(NMDevice *self, NMDevice *slave, gboolean configure) +nm_device_controller_add_port(NMDevice *self, NMDevice *port, gboolean configure) { NMDevicePrivate *priv; NMDevicePrivate *port_priv; - SlaveInfo *info; + PortInfo *info; gboolean changed = FALSE; g_return_val_if_fail(NM_IS_DEVICE(self), FALSE); - g_return_val_if_fail(NM_IS_DEVICE(slave), FALSE); + g_return_val_if_fail(NM_IS_DEVICE(port), FALSE); g_return_val_if_fail(NM_DEVICE_GET_CLASS(self)->attach_port, FALSE); priv = NM_DEVICE_GET_PRIVATE(self); - port_priv = NM_DEVICE_GET_PRIVATE(slave); + port_priv = NM_DEVICE_GET_PRIVATE(port); - info = find_slave_info(self, slave); + info = find_port_info(self, port); _LOGT(LOGD_CORE, - "controller: add one slave " NM_HASH_OBFUSCATE_PTR_FMT "/%s%s", - NM_HASH_OBFUSCATE_PTR(slave), - nm_device_get_iface(slave), + "controller: add one port " NM_HASH_OBFUSCATE_PTR_FMT "/%s%s", + NM_HASH_OBFUSCATE_PTR(port), + nm_device_get_iface(port), info ? " (already registered)" : ""); if (configure) - g_return_val_if_fail(nm_device_get_state(slave) >= NM_DEVICE_STATE_DISCONNECTED, FALSE); + g_return_val_if_fail(nm_device_get_state(port) >= NM_DEVICE_STATE_DISCONNECTED, FALSE); if (!info) { g_return_val_if_fail(!port_priv->controller, FALSE); - g_return_val_if_fail(!port_priv->is_enslaved, FALSE); + g_return_val_if_fail(!port_priv->is_attached, FALSE); - info = g_slice_new0(SlaveInfo); - info->slave = g_object_ref(slave); + info = g_slice_new0(PortInfo); + info->port = g_object_ref(port); info->configure = configure; info->watch_id = - g_signal_connect(slave, NM_DEVICE_STATE_CHANGED, G_CALLBACK(slave_state_changed), self); - c_list_link_tail(&priv->slaves, &info->lst_slave); + g_signal_connect(port, NM_DEVICE_STATE_CHANGED, G_CALLBACK(port_state_changed), self); + c_list_link_tail(&priv->ports, &info->lst_port); port_priv->controller = g_object_ref(self); _active_connection_set_state_flags(self, NM_ACTIVATION_STATE_FLAG_MASTER_HAS_SLAVES); /* no need to emit * - * _notify (slave, PROP_CONTROLLER); + * _notify (port, PROP_CONTROLLER); * - * because port_priv->is_enslaved is not true, thus the value + * because port_priv->is_attached is not true, thus the value * didn't change yet. */ - g_warn_if_fail(!NM_FLAGS_HAS(port_priv->unmanaged_mask, NM_UNMANAGED_IS_SLAVE)); - nm_device_set_unmanaged_by_flags(slave, - NM_UNMANAGED_IS_SLAVE, + g_warn_if_fail(!NM_FLAGS_HAS(port_priv->unmanaged_mask, NM_UNMANAGED_IS_PORT)); + nm_device_set_unmanaged_by_flags(port, + NM_UNMANAGED_IS_PORT, NM_UNMAN_FLAG_OP_SET_MANAGED, NM_DEVICE_STATE_REASON_CONNECTION_ASSUMED); changed = TRUE; @@ -8554,44 +8554,44 @@ nm_device_controller_add_slave(NMDevice *self, NMDevice *slave, gboolean configu g_return_val_if_fail(port_priv->controller == self, FALSE); nm_device_queue_recheck_assume(self); - nm_device_queue_recheck_assume(slave); + nm_device_queue_recheck_assume(port); return changed; } /** - * nm_device_controller_check_slave_physical_port: + * nm_device_controller_check_port_physical_port: * @self: the controller device - * @slave: a slave device + * @port: a port device * @log_domain: domain to log a warning in * - * Checks if @self already has a slave with the same #NMDevice:physical-port-id - * as @slave, and logs a warning if so. + * Checks if @self already has a port with the same #NMDevice:physical-port-id + * as @port, and logs a warning if so. */ void -nm_device_controller_check_slave_physical_port(NMDevice *self, - NMDevice *slave, - NMLogDomain log_domain) +nm_device_controller_check_port_physical_port(NMDevice *self, + NMDevice *port, + NMLogDomain log_domain) { NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE(self); - const char *slave_physical_port_id, *existing_physical_port_id; - SlaveInfo *info; + const char *port_physical_port_id, *existing_physical_port_id; + PortInfo *info; - slave_physical_port_id = nm_device_get_physical_port_id(slave); - if (!slave_physical_port_id) + port_physical_port_id = nm_device_get_physical_port_id(port); + if (!port_physical_port_id) return; - c_list_for_each_entry (info, &priv->slaves, lst_slave) { - if (info->slave == slave) + c_list_for_each_entry (info, &priv->ports, lst_port) { + if (info->port == port) continue; - existing_physical_port_id = nm_device_get_physical_port_id(info->slave); - if (nm_streq0(slave_physical_port_id, existing_physical_port_id)) { + existing_physical_port_id = nm_device_get_physical_port_id(info->port); + if (nm_streq0(port_physical_port_id, existing_physical_port_id)) { _LOGW(log_domain, - "slave %s shares a physical port with existing slave %s", - nm_device_get_ip_iface(slave), - nm_device_get_ip_iface(info->slave)); - /* Since this function will get called for every slave, we only have + "port %s shares a physical port with existing port %s", + nm_device_get_ip_iface(port), + nm_device_get_ip_iface(info->port)); + /* Since this function will get called for every port, we only have * to warn about the first match we find; if there are other matches * later in the list, we will have already warned about them matching * @existing earlier. @@ -8602,14 +8602,14 @@ nm_device_controller_check_slave_physical_port(NMDevice *self, } void -nm_device_controller_release_slaves_all(NMDevice *self) +nm_device_controller_release_ports_all(NMDevice *self) { NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE(self); NMDeviceStateReason reason; - SlaveInfo *info; - SlaveInfo *safe; + PortInfo *info; + PortInfo *safe; - /* Don't release the slaves if this connection doesn't belong to NM. */ + /* Don't release the ports if this connection doesn't belong to NM. */ if (nm_device_sys_iface_state_is_external(self)) return; @@ -8617,15 +8617,15 @@ nm_device_controller_release_slaves_all(NMDevice *self) if (priv->state == NM_DEVICE_STATE_FAILED) reason = NM_DEVICE_STATE_REASON_DEPENDENCY_FAILED; - c_list_for_each_entry_safe (info, safe, &priv->slaves, lst_slave) { + c_list_for_each_entry_safe (info, safe, &priv->ports, lst_port) { if (priv->activation_state_preserve_external_ports - && nm_device_sys_iface_state_is_external(info->slave)) { + && nm_device_sys_iface_state_is_external(info->port)) { _LOGT(LOGD_DEVICE, "controller: preserve external port %s", - nm_device_get_iface(info->slave)); + nm_device_get_iface(info->port)); continue; } - nm_device_controller_release_slave(self, info->slave, RELEASE_SLAVE_TYPE_CONFIG, reason); + nm_device_controller_release_port(self, info->port, RELEASE_PORT_TYPE_CONFIG, reason); } /* We only need this flag for a short time. It served its purpose. Clear @@ -8665,7 +8665,7 @@ nm_device_get_controller(NMDevice *self) { NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE(self); - if (priv->is_enslaved) { + if (priv->is_attached) { g_return_val_if_fail(priv->controller, NULL); return priv->controller; } @@ -8673,15 +8673,15 @@ nm_device_get_controller(NMDevice *self) } /** - * nm_device_slave_notify_enslave: - * @self: the slave device + * nm_device_port_notify_attach: + * @self: the port device * @success: whether the enslaving operation succeeded * - * Notifies a slave that either it has been enslaved, or else its controller tried - * to enslave it and failed. + * Notifies a port that either it has been attached, or else its controller tried + * to attach it as port and failed. */ static void -nm_device_slave_notify_enslave(NMDevice *self, gboolean success) +nm_device_port_notify_attach_as_port(NMDevice *self, gboolean success) { NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE(self); NMConnection *connection = nm_device_get_applied_connection(self); @@ -8689,16 +8689,16 @@ nm_device_slave_notify_enslave(NMDevice *self, gboolean success) g_return_if_fail(priv->controller); - if (!priv->is_enslaved) { + if (!priv->is_attached) { if (success) { if (activating) { _LOGI(LOGD_DEVICE, - "Activation: connection '%s' enslaved, continuing activation", + "Activation: connection '%s' attached as port, continuing activation", nm_connection_get_id(connection)); } else - _LOGI(LOGD_DEVICE, "enslaved to %s", nm_device_get_iface(priv->controller)); + _LOGI(LOGD_DEVICE, "attached to %s", nm_device_get_iface(priv->controller)); - priv->is_enslaved = TRUE; + priv->is_attached = TRUE; _notify(priv->controller, PROP_CONTROLLER); @@ -8707,7 +8707,7 @@ nm_device_slave_notify_enslave(NMDevice *self, gboolean success) nm_gobject_notify_together(priv->controller, PROP_PORTS, PROP_SLAVES); } else if (activating) { _LOGW(LOGD_DEVICE, - "Activation: connection '%s' could not be enslaved", + "Activation: connection '%s' could not be attached as port", nm_connection_get_id(connection)); } } @@ -8726,16 +8726,16 @@ nm_device_slave_notify_enslave(NMDevice *self, gboolean success) } /** - * nm_device_slave_notify_release: - * @self: the slave device + * nm_device_port_notify_release: + * @self: the port device * @reason: the reason associated with the state change * - * Notifies a slave that it has been released, and why. + * Notifies a port that it has been released, and why. */ static void -nm_device_slave_notify_release(NMDevice *self, - NMDeviceStateReason reason, - ReleaseSlaveType release_type) +nm_device_port_notify_release(NMDevice *self, + NMDeviceStateReason reason, + ReleasePortType release_type) { NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE(self); NMConnection *connection = nm_device_get_applied_connection(self); @@ -8743,7 +8743,7 @@ nm_device_slave_notify_release(NMDevice *self, g_return_if_fail(priv->controller); - if (!priv->is_enslaved && release_type == RELEASE_SLAVE_TYPE_NO_CONFIG) + if (!priv->is_attached && release_type == RELEASE_PORT_TYPE_NO_CONFIG) return; if (priv->state > NM_DEVICE_STATE_DISCONNECTED && priv->state <= NM_DEVICE_STATE_ACTIVATED) { @@ -8777,7 +8777,7 @@ nm_device_slave_notify_release(NMDevice *self, "released from controller device %s", nm_device_get_iface(priv->controller)); - priv->is_enslaved = FALSE; + priv->is_attached = FALSE; _notify(priv->controller, PROP_CONTROLLER); @@ -8792,7 +8792,7 @@ nm_device_slave_notify_release(NMDevice *self, * of the device (provided, it is still not cleared at this point). * * Called by the manager when the device was removed. Releases the device from - * the controller in case it's enslaved. + * the controller in case it's attached as port. */ void nm_device_removed(NMDevice *self, gboolean unconfigure_ip_config) @@ -8807,12 +8807,12 @@ nm_device_removed(NMDevice *self, gboolean unconfigure_ip_config) priv = NM_DEVICE_GET_PRIVATE(self); if (priv->controller) { - /* this is called when something externally messes with the slave or during shut-down. - * Release the slave from controller, but don't touch the device. */ - nm_device_controller_release_slave(priv->controller, - self, - RELEASE_SLAVE_TYPE_NO_CONFIG, - NM_DEVICE_STATE_REASON_CONNECTION_ASSUMED); + /* this is called when something externally messes with the port or during shut-down. + * Release the port from controller, but don't touch the device. */ + nm_device_controller_release_port(priv->controller, + self, + RELEASE_PORT_TYPE_NO_CONFIG, + NM_DEVICE_STATE_REASON_CONNECTION_ASSUMED); } _dev_l3_register_l3cds(self, priv->l3cfg, FALSE, unconfigure_ip_config); @@ -9095,7 +9095,7 @@ device_has_config(NMDevice *self) return FALSE; if (pllink->controller > 0) { - /* Master-slave relationship is also a configuration */ + /* Master-port relationship is also a configuration */ return TRUE; } @@ -9120,30 +9120,30 @@ device_has_config(NMDevice *self) } /** - * nm_device_controller_update_slave_connection: + * nm_device_controller_update_port_connection: * @self: the controller #NMDevice - * @slave: the slave #NMDevice - * @connection: the #NMConnection to update with the slave settings + * @port: the port #NMDevice + * @connection: the #NMConnection to update with the port settings * @error: error description * - * Reads the slave configuration for @slave and updates @connection with those + * Reads the port configuration for @port and updates @connection with those * properties. This invokes a virtual function on the controller device @self. * * Returns: %TRUE if the configuration was read and @connection updated, * %FALSE on failure. */ gboolean -nm_device_controller_update_slave_connection(NMDevice *self, - NMDevice *slave, - NMConnection *connection, - GError **error) +nm_device_controller_update_port_connection(NMDevice *self, + NMDevice *port, + NMConnection *connection, + GError **error) { NMDeviceClass *klass; gboolean success; g_return_val_if_fail(self, FALSE); g_return_val_if_fail(NM_IS_DEVICE(self), FALSE); - g_return_val_if_fail(slave, FALSE); + g_return_val_if_fail(port, FALSE); g_return_val_if_fail(connection, FALSE); g_return_val_if_fail(!error || !*error, FALSE); g_return_val_if_fail(nm_connection_get_setting_connection(connection), FALSE); @@ -9151,8 +9151,8 @@ nm_device_controller_update_slave_connection(NMDevice *self, g_return_val_if_fail(nm_device_get_iface(self), FALSE); klass = NM_DEVICE_GET_CLASS(self); - if (klass->controller_update_slave_connection) { - success = klass->controller_update_slave_connection(self, slave, connection, error); + if (klass->controller_update_port_connection) { + success = klass->controller_update_port_connection(self, port, connection, error); g_return_val_if_fail(!error || (success && !*error) || *error, success); return success; @@ -9162,10 +9162,10 @@ nm_device_controller_update_slave_connection(NMDevice *self, error, NM_DEVICE_ERROR, NM_DEVICE_ERROR_FAILED, - "controller device '%s' cannot update a slave connection for slave device '%s' (controller " + "controller device '%s' cannot update a port connection for port device '%s' (controller " "type not supported?)", nm_device_get_iface(self), - nm_device_get_iface(slave)); + nm_device_get_iface(port)); return FALSE; } @@ -9259,13 +9259,13 @@ nm_device_generate_connection(NMDevice *self, nm_connection_add_setting(connection, s_con); - /* If the device is a slave, update various slave settings */ + /* If the device is a port, update various port settings */ if (controller) { - if (!nm_device_controller_update_slave_connection(controller, self, connection, &local)) { + if (!nm_device_controller_update_port_connection(controller, self, connection, &local)) { g_set_error(error, NM_DEVICE_ERROR, NM_DEVICE_ERROR_FAILED, - "controller device '%s' failed to update slave connection: %s", + "controller device '%s' failed to update port connection: %s", nm_device_get_iface(controller), local->message); g_error_free(local); @@ -9273,7 +9273,7 @@ nm_device_generate_connection(NMDevice *self, return NULL; } } else { - /* Only regular and controller devices get IP configuration; slaves do not */ + /* Only regular and controller devices get IP configuration; ports do not */ s_ip4 = nm_utils_platform_capture_ip_setting(nm_device_get_platform(self), AF_INET, nm_device_get_ip_ifindex(self), @@ -9314,7 +9314,7 @@ nm_device_generate_connection(NMDevice *self, } /* Ignore the connection if it has no IP configuration, - * no slave configuration, and is not a controller interface. + * no port configuration, and is not a controller interface. */ ip4_method = nm_utils_get_ip_config_method(connection, AF_INET); ip6_method = nm_utils_get_ip_config_method(connection, AF_INET6); @@ -9323,33 +9323,33 @@ nm_device_generate_connection(NMDevice *self, NM_SETTING_IP6_CONFIG_METHOD_IGNORE, NM_SETTING_IP6_CONFIG_METHOD_DISABLED) && !nm_setting_connection_get_controller(NM_SETTING_CONNECTION(s_con)) - && c_list_is_empty(&priv->slaves)) { + && c_list_is_empty(&priv->ports)) { NM_SET_OUT(out_maybe_later, TRUE); g_set_error_literal( error, NM_DEVICE_ERROR, NM_DEVICE_ERROR_FAILED, - "ignoring generated connection (no IP and not in controller-slave relationship)"); + "ignoring generated connection (no IP and not in controller-port relationship)"); return NULL; } - /* Ignore any IPv6LL-only, not controller connections without slaves, + /* Ignore any IPv6LL-only, not controller connections without ports, * unless they are in the assume-ipv6ll-only list. */ if (nm_streq0(ip4_method, NM_SETTING_IP4_CONFIG_METHOD_DISABLED) && nm_streq0(ip6_method, NM_SETTING_IP6_CONFIG_METHOD_LINK_LOCAL) && !nm_setting_connection_get_controller(NM_SETTING_CONNECTION(s_con)) - && c_list_is_empty(&priv->slaves) + && c_list_is_empty(&priv->ports) && !nm_config_data_get_assume_ipv6ll_only(NM_CONFIG_GET_DATA, self)) { _LOGD( LOGD_DEVICE, - "ignoring generated connection (IPv6LL-only and not in controller-slave relationship)"); + "ignoring generated connection (IPv6LL-only and not in controller-port relationship)"); NM_SET_OUT(out_maybe_later, TRUE); g_set_error_literal( error, NM_DEVICE_ERROR, NM_DEVICE_ERROR_FAILED, - "ignoring generated connection (IPv6LL-only and not in controller-slave relationship)"); + "ignoring generated connection (IPv6LL-only and not in controller-port relationship)"); return NULL; } @@ -9600,13 +9600,13 @@ nm_device_check_connection_compatible(NMDevice *self, } gboolean -nm_device_check_slave_connection_compatible(NMDevice *self, NMConnection *slave) +nm_device_check_port_connection_compatible(NMDevice *self, NMConnection *port) { NMSettingConnection *s_con; - const char *connection_type, *slave_type; + const char *connection_type, *port_type; g_return_val_if_fail(NM_IS_DEVICE(self), FALSE); - g_return_val_if_fail(NM_IS_CONNECTION(slave), FALSE); + g_return_val_if_fail(NM_IS_CONNECTION(port), FALSE); if (!nm_device_is_controller(self)) return FALSE; @@ -9615,13 +9615,13 @@ nm_device_check_slave_connection_compatible(NMDevice *self, NMConnection *slave) connection_type = NM_DEVICE_GET_CLASS(self)->connection_type_supported; g_return_val_if_fail(connection_type, FALSE); - s_con = nm_connection_get_setting_connection(slave); + s_con = nm_connection_get_setting_connection(port); g_assert(s_con); - slave_type = nm_setting_connection_get_port_type(s_con); - if (!slave_type) + port_type = nm_setting_connection_get_port_type(s_con); + if (!port_type) return FALSE; - return nm_streq(connection_type, slave_type); + return nm_streq(connection_type, port_type); } gboolean @@ -9929,15 +9929,15 @@ controller_ready(NMDevice *self, NMActiveConnection *active) nm_device_get_iface(controller)); if (priv->controller && priv->controller != controller) - nm_device_controller_release_slave(priv->controller, - self, - RELEASE_SLAVE_TYPE_NO_CONFIG, - NM_DEVICE_STATE_REASON_CONNECTION_ASSUMED); + nm_device_controller_release_port(priv->controller, + self, + RELEASE_PORT_TYPE_NO_CONFIG, + NM_DEVICE_STATE_REASON_CONNECTION_ASSUMED); - /* If the controller didn't change, add-slave only rechecks whether to assume a connection. */ - nm_device_controller_add_slave(controller, - self, - !nm_device_sys_iface_state_is_external_or_assume(self)); + /* If the controller didn't change, add-port only rechecks whether to assume a connection. */ + nm_device_controller_add_port(controller, + self, + !nm_device_sys_iface_state_is_external_or_assume(self)); } static void @@ -10224,10 +10224,10 @@ activate_stage1_device_prepare(NMDevice *self) if (controller) controller_ready(self, active); else if (priv->controller) { - nm_device_controller_release_slave(priv->controller, - self, - RELEASE_SLAVE_TYPE_CONFIG_FORCE, - NM_DEVICE_STATE_REASON_CONNECTION_ASSUMED); + nm_device_controller_release_port(priv->controller, + self, + RELEASE_PORT_TYPE_CONFIG_FORCE, + NM_DEVICE_STATE_REASON_CONNECTION_ASSUMED); } nm_device_activate_schedule_stage2_device_config(self, TRUE); @@ -10455,7 +10455,7 @@ activate_stage2_device_config(NMDevice *self) NMActStageReturn ret; NMSettingWired *s_wired; gboolean no_firmware = FALSE; - SlaveInfo *info; + PortInfo *info; NMTernary accept_all_mac_addresses; nm_device_state_changed(self, NM_DEVICE_STATE_CONFIG, NM_DEVICE_STATE_REASON_NONE); @@ -10503,17 +10503,17 @@ activate_stage2_device_config(NMDevice *self) } } - /* If we have slaves that aren't yet enslaved, do that now */ - c_list_for_each_entry (info, &priv->slaves, lst_slave) { - NMDeviceState slave_state = nm_device_get_state(info->slave); + /* If we have ports that aren't yet attached, do that now */ + c_list_for_each_entry (info, &priv->ports, lst_port) { + NMDeviceState port_state = nm_device_get_state(info->port); - if (slave_state == NM_DEVICE_STATE_IP_CONFIG) - nm_device_controller_enslave_slave(self, - info->slave, - nm_device_get_applied_connection(info->slave)); + if (port_state == NM_DEVICE_STATE_IP_CONFIG) + nm_device_controller_attach_port(self, + info->port, + nm_device_get_applied_connection(info->port)); else if (priv->act_request.obj && nm_device_sys_iface_state_is_external(self) - && slave_state <= NM_DEVICE_STATE_DISCONNECTED) - nm_device_queue_recheck_assume(info->slave); + && port_state <= NM_DEVICE_STATE_DISCONNECTED) + nm_device_queue_recheck_assume(info->port); } s_wired = nm_device_get_applied_setting(self, NM_TYPE_SETTING_WIRED); @@ -11459,7 +11459,7 @@ connection_requires_carrier(NMConnection *connection) gboolean ip4_used = FALSE; gboolean ip6_used = FALSE; - /* We can progress to IP_CONFIG now, so that we're enslaved. + /* We can progress to IP_CONFIG now, so that we're attached as port. * That may actually cause carrier to go up and thus continue activation. */ s_con = nm_connection_get_setting_connection(connection); if (nm_setting_connection_get_controller(s_con)) @@ -11498,17 +11498,17 @@ connection_requires_carrier(NMConnection *connection) } static gboolean -have_any_ready_slaves(NMDevice *self) +have_any_ready_ports(NMDevice *self) { NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE(self); - SlaveInfo *info; + PortInfo *info; - /* Any enslaved slave is "ready" in the generic case as it's + /* Any attached port is "ready" in the generic case as it's * at least >= NM_DEVICE_STATE_IP_CONFIG and has had Layer 2 * properties set up. */ - c_list_for_each_entry (info, &priv->slaves, lst_slave) { - if (NM_DEVICE_GET_PRIVATE(info->slave)->is_enslaved) + c_list_for_each_entry (info, &priv->ports, lst_port) { + if (NM_DEVICE_GET_PRIVATE(info->port)->is_attached) return TRUE; } return FALSE; @@ -11932,9 +11932,9 @@ _set_mtu(NMDevice *self, guint32 mtu) _notify(self, PROP_MTU); if (priv->controller) { - /* changing the MTU of a slave, might require the controller to reset + /* changing the MTU of a port, might require the controller to reset * its MTU. Note that the controller usually cannot set a MTU larger - * then the slave's. Hence, when the slave increases the MTU, + * then the port's. Hence, when the port increases the MTU, * controller might want to retry setting the MTU. */ nm_device_commit_mtu(priv->controller); } @@ -12050,8 +12050,8 @@ _commit_mtu(NMDevice *self) /* the interface has IPv6 enabled. The MTU with IPv6 cannot be smaller * then 1280. * - * For slave-devices (that don't have @s_ip6 we) don't do this fixup because - * it's anyway an unsolved problem when the slave configures a conflicting + * For port-devices (that don't have @s_ip6 we) don't do this fixup because + * it's anyway an unsolved problem when the port configures a conflicting * MTU. */ mtu_desired = 1280; } @@ -12153,8 +12153,8 @@ _commit_mtu(NMDevice *self) "mtu: failure to set MTU. %s", NM_IS_DEVICE_VLAN(self) ? "Is the parent's MTU size large enough?" - : (!c_list_is_empty(&priv->slaves) - ? "Are the MTU sizes of the slaves large enough?" + : (!c_list_is_empty(&priv->ports) + ? "Are the MTU sizes of the ports large enough?" : "Did you configure the MTU correctly?")); } priv->carrier_wait_until_msec = @@ -12670,7 +12670,7 @@ _dev_addrgenmode6_set(NMDevice *self, guint8 addr_gen_mode) /*****************************************************************************/ static gboolean -ip_requires_slaves(NMDevice *self, int addr_family) +ip_requires_ports(NMDevice *self, int addr_family) { const char *method; @@ -12679,7 +12679,7 @@ ip_requires_slaves(NMDevice *self, int addr_family) if (NM_IS_IPv4(addr_family)) return nm_streq(method, NM_SETTING_IP4_CONFIG_METHOD_AUTO); - /* SLAAC, DHCP, and Link-Local depend on connectivity (and thus slaves) + /* SLAAC, DHCP, and Link-Local depend on connectivity (and thus ports) * to complete addressing. SLAAC and DHCP need a peer to provide a prefix. */ return NM_IN_STRSET(method, @@ -12724,11 +12724,11 @@ activate_stage3_ip_config_for_addr_family(NMDevice *self, int addr_family, const priv->ip_data_x[IS_IPv4].wait_for_carrier = FALSE; } - if (nm_device_is_controller(self) && ip_requires_slaves(self, addr_family)) { - /* If the controller has no ready slaves, and depends on slaves for + if (nm_device_is_controller(self) && ip_requires_ports(self, addr_family)) { + /* If the controller has no ready ports, and depends on ports for * a successful IP configuration attempt, then postpone IP addressing. */ - if (!have_any_ready_slaves(self)) { + if (!have_any_ready_ports(self)) { if (!priv->ip_data_x[IS_IPv4].wait_for_ports) { _LOGT_ip(addr_family, "waiting for ports"); priv->ip_data_x[IS_IPv4].wait_for_ports = TRUE; @@ -12774,10 +12774,10 @@ activate_stage3_ip_config_for_addr_family(NMDevice *self, int addr_family, const if (priv->controller) { /* If a device only has an IPv6 link-local address, * we don't generate an assumed connection. Therefore, - * when a new slave connection (without IP configuration) + * when a new port connection (without IP configuration) * is activated on the device, the link-local address * remains configured. The IP configuration of an activated - * slave should not depend on the previous state. Flush + * port should not depend on the previous state. Flush * addresses and routes on activation. */ if (ip_ifindex > 0) { @@ -15086,7 +15086,7 @@ NM_UTILS_FLAGS2STR_DEFINE(nm_unmanaged_flags2str, NM_UTILS_FLAGS2STR(NM_UNMANAGED_USER_CONF, "user-conf"), NM_UTILS_FLAGS2STR(NM_UNMANAGED_USER_UDEV, "user-udev"), NM_UTILS_FLAGS2STR(NM_UNMANAGED_EXTERNAL_DOWN, "external-down"), - NM_UTILS_FLAGS2STR(NM_UNMANAGED_IS_SLAVE, "is-slave"), ); + NM_UTILS_FLAGS2STR(NM_UNMANAGED_IS_PORT, "is-port"), ); static const char * _unmanaged_flags2str(NMUnmanagedFlags flags, NMUnmanagedFlags mask, char *buf, gsize len) @@ -15217,8 +15217,8 @@ _get_managed_by_flags(NMUnmanagedFlags flags, flags &= ~(NM_UNMANAGED_BY_DEFAULT | NM_UNMANAGED_USER_UDEV | NM_UNMANAGED_EXTERNAL_DOWN); } - if (NM_FLAGS_HAS(mask, NM_UNMANAGED_IS_SLAVE) && !NM_FLAGS_HAS(flags, NM_UNMANAGED_IS_SLAVE)) { - /* for an enslaved device, by-default doesn't matter */ + if (NM_FLAGS_HAS(mask, NM_UNMANAGED_IS_PORT) && !NM_FLAGS_HAS(flags, NM_UNMANAGED_IS_PORT)) { + /* for an attached device, by-default doesn't matter */ flags &= ~NM_UNMANAGED_BY_DEFAULT; } @@ -16000,7 +16000,7 @@ check_connection_available(NMDevice *self, if (nm_device_is_controller(self)) { /* controller types are always available even without carrier. - * Making connection non-available would un-enslave slaves which + * Making connection non-available would de-attach ports which * is not desired. */ return TRUE; } @@ -16454,8 +16454,8 @@ nm_device_cleanup(NMDevice *self, NMDeviceStateReason reason, CleanupType cleanu ifindex = nm_device_get_ip_ifindex(self); if (cleanup_type == CLEANUP_TYPE_DECONFIGURE) { - /* controller: release slaves */ - nm_device_controller_release_slaves_all(self); + /* controller: release ports */ + nm_device_controller_release_ports_all(self); /* Take out any entries in the routing table and any IP address the device had. */ if (ifindex > 0) { @@ -16477,13 +16477,13 @@ nm_device_cleanup(NMDevice *self, NMDeviceStateReason reason, CleanupType cleanu if (ifindex > 0) nm_platform_ip4_dev_route_blacklist_set(nm_device_get_platform(self), ifindex, NULL); - /* slave: mark no longer enslaved */ + /* port: mark no longer attached */ if (priv->controller && priv->ifindex > 0 && nm_platform_link_get_controller(nm_device_get_platform(self), priv->ifindex) <= 0) { - nm_device_controller_release_slave(priv->controller, - self, - RELEASE_SLAVE_TYPE_NO_CONFIG, - NM_DEVICE_STATE_REASON_CONNECTION_ASSUMED); + nm_device_controller_release_port(priv->controller, + self, + RELEASE_PORT_TYPE_NO_CONFIG, + NM_DEVICE_STATE_REASON_CONNECTION_ASSUMED); } lldp_setup(self, NM_TERNARY_FALSE); @@ -17004,8 +17004,8 @@ _set_state_full(NMDevice *self, NMDeviceState state, NMDeviceStateReason reason, "Activation: failed for connection '%s'", sett_conn ? nm_settings_connection_get_id(sett_conn) : ""); - /* Notify any slaves of the unexpected failure */ - nm_device_controller_release_slaves_all(self); + /* Notify any ports of the unexpected failure */ + nm_device_controller_release_ports_all(self); /* If the connection doesn't yet have a timestamp, set it to zero so that * we can distinguish between connections we've tried to activate and have @@ -18399,19 +18399,19 @@ static GVariant * _device_get_ports_variant(NMDevice *device) { NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE(device); - SlaveInfo *info; + PortInfo *info; GVariantBuilder builder; gboolean any = FALSE; if (priv->ports_variant) return priv->ports_variant; - c_list_for_each_entry (info, &priv->slaves, lst_slave) { + c_list_for_each_entry (info, &priv->ports, lst_port) { const char *path; - if (!NM_DEVICE_GET_PRIVATE(info->slave)->is_enslaved) + if (!NM_DEVICE_GET_PRIVATE(info->port)->is_attached) continue; - path = nm_dbus_object_get_path(NM_DBUS_OBJECT(info->slave)); + path = nm_dbus_object_get_path(NM_DBUS_OBJECT(info->port)); if (!path) continue; if (!any) { @@ -18698,7 +18698,7 @@ nm_device_init(NMDevice *self) c_list_init(&self->devices_lst); c_list_init(&self->devcon_dev_lst_head); c_list_init(&self->policy_auto_activate_lst); - c_list_init(&priv->slaves); + c_list_init(&priv->ports); priv->ipdhcp_data_6.v6.mode = NM_NDISC_DHCP_LEVEL_NONE; @@ -18852,7 +18852,7 @@ dispose(GObject *object) _cleanup_generic_pre(self, CLEANUP_TYPE_KEEP); - nm_assert(c_list_is_empty(&priv->slaves)); + nm_assert(c_list_is_empty(&priv->ports)); /* Let the kernel manage IPv6LL again */ _dev_addrgenmode6_set(self, NM_IN6_ADDR_GEN_MODE_EUI64); diff --git a/src/core/devices/nm-device.h b/src/core/devices/nm-device.h index 787f4b3ed..37eda5c0c 100644 --- a/src/core/devices/nm-device.h +++ b/src/core/devices/nm-device.h @@ -375,10 +375,10 @@ typedef struct _NMDeviceClass { /* Update the connection with currently configured L2 settings */ void (*update_connection)(NMDevice *device, NMConnection *connection); - gboolean (*controller_update_slave_connection)(NMDevice *self, - NMDevice *slave, - NMConnection *connection, - GError **error); + gboolean (*controller_update_port_connection)(NMDevice *self, + NMDevice *port, + NMConnection *connection, + GError **error); /* Attachs a port asynchronously. Returns TRUE/FALSE on immediate * success/error; in such cases, the callback is not invoked. If the @@ -530,10 +530,10 @@ NMConnection *nm_device_generate_connection(NMDevice *self, gboolean *out_maybe_later, GError **error); -gboolean nm_device_controller_update_slave_connection(NMDevice *controller, - NMDevice *slave, - NMConnection *connection, - GError **error); +gboolean nm_device_controller_update_port_connection(NMDevice *controller, + NMDevice *port, + NMConnection *connection, + GError **error); gboolean nm_device_can_auto_connect(NMDevice *self, NMSettingsConnection *sett_conn, char **specific_object); @@ -549,7 +549,7 @@ gboolean nm_device_check_connection_compatible(NMDevice *device, gboolean check_properties, GError **error); -gboolean nm_device_check_slave_connection_compatible(NMDevice *device, NMConnection *connection); +gboolean nm_device_check_port_connection_compatible(NMDevice *device, NMConnection *connection); gboolean nm_device_can_be_parent(NMDevice *device); gboolean nm_device_can_assume_connections(NMDevice *self); @@ -603,9 +603,9 @@ void nm_device_copy_ip6_dns_config(NMDevice *self, NMDevice *from_device); * them by default * @NM_UNMANAGED_USER_UDEV: %TRUE when unmanaged by user decision (via UDev rule) * @NM_UNMANAGED_EXTERNAL_DOWN: %TRUE when unmanaged because !IFF_UP and not created by NM - * @NM_UNMANAGED_IS_SLAVE: indicates that the device is enslaved. Note that - * setting the NM_UNMANAGED_IS_SLAVE to %TRUE makes no sense, this flag has only - * meaning to set a slave device as managed if the parent is managed too. + * @NM_UNMANAGED_IS_PORT: indicates that the device is attached as port. Note that + * setting the NM_UNMANAGED_IS_PORT to %TRUE makes no sense, this flag has only + * meaning to set a port device as managed if the parent is managed too. */ typedef enum { NM_UNMANAGED_NONE = 0, @@ -624,7 +624,7 @@ typedef enum { NM_UNMANAGED_USER_CONF = (1LL << 6), NM_UNMANAGED_USER_UDEV = (1LL << 7), NM_UNMANAGED_EXTERNAL_DOWN = (1LL << 8), - NM_UNMANAGED_IS_SLAVE = (1LL << 9), + NM_UNMANAGED_IS_PORT = (1LL << 9), NM_UNMANAGED_ALL = ((1LL << 10) - 1), } NMUnmanagedFlags; diff --git a/src/core/devices/ovs/nm-device-ovs-bridge.c b/src/core/devices/ovs/nm-device-ovs-bridge.c index 27d040038..097776693 100644 --- a/src/core/devices/ovs/nm-device-ovs-bridge.c +++ b/src/core/devices/ovs/nm-device-ovs-bridge.c @@ -49,7 +49,7 @@ create_and_realize(NMDevice *device, const NMPlatformLink **out_plink, GError **error) { - /* The actual backing resources will be created on enslavement by the port + /* The actual backing resources will be created on attachment by the port * when it can identify the port and the bridge. */ return TRUE; diff --git a/src/core/devices/ovs/nm-device-ovs-port.c b/src/core/devices/ovs/nm-device-ovs-port.c index e10202806..2acafba23 100644 --- a/src/core/devices/ovs/nm-device-ovs-port.c +++ b/src/core/devices/ovs/nm-device-ovs-port.c @@ -48,7 +48,7 @@ create_and_realize(NMDevice *device, const NMPlatformLink **out_plink, GError **error) { - /* The port will be added to ovsdb when an interface is enslaved, + /* The port will be added to ovsdb when an interface is attached as port, * because there's no such thing like an empty port. */ return TRUE; diff --git a/src/core/devices/team/nm-device-team.c b/src/core/devices/team/nm-device-team.c index fd185b940..0f420a7a2 100644 --- a/src/core/devices/team/nm-device-team.c +++ b/src/core/devices/team/nm-device-team.c @@ -238,10 +238,10 @@ update_connection(NMDevice *device, NMConnection *connection) /*****************************************************************************/ static gboolean -controller_update_slave_connection(NMDevice *device, - NMDevice *slave, - NMConnection *connection, - GError **error) +controller_update_port_connection(NMDevice *device, + NMDevice *port, + NMConnection *connection, + GError **error) { NMDeviceTeam *self = NM_DEVICE_TEAM(device); NMSettingTeamPort *s_port; @@ -251,7 +251,7 @@ controller_update_slave_connection(NMDevice *device, struct teamdctl *tdc; const char *team_port_config = NULL; const char *iface = nm_device_get_iface(device); - const char *iface_slave = nm_device_get_iface(slave); + const char *iface_port = nm_device_get_iface(port); NMConnection *applied_connection = nm_device_get_applied_connection(device); tdc = _tdc_connect_new(self, iface, &connect_error); @@ -260,15 +260,15 @@ controller_update_slave_connection(NMDevice *device, error, NM_DEVICE_ERROR, NM_DEVICE_ERROR_FAILED, - "update slave connection for slave '%s' failed to connect to teamd for controller " + "update port connection for port '%s' failed to connect to teamd for controller " "%s (%s)", - iface_slave, + iface_port, iface, connect_error->message); return FALSE; } - err = teamdctl_port_config_get_raw_direct(tdc, iface_slave, (char **) &team_port_config); + err = teamdctl_port_config_get_raw_direct(tdc, iface_port, (char **) &team_port_config); port_config = g_strdup(team_port_config); teamdctl_disconnect(tdc); teamdctl_free(tdc); @@ -276,9 +276,9 @@ controller_update_slave_connection(NMDevice *device, g_set_error(error, NM_DEVICE_ERROR, NM_DEVICE_ERROR_FAILED, - "update slave connection for slave '%s' failed to get configuration from teamd " + "update port connection for port '%s' failed to get configuration from teamd " "controller %s (err=%d)", - iface_slave, + iface_port, iface, err); g_free(port_config); @@ -859,7 +859,7 @@ attach_port(NMDevice *device, const char *port_iface = nm_device_get_ip_iface(port); NMSettingTeamPort *s_team_port; - nm_device_controller_check_slave_physical_port(device, port, LOGD_TEAM); + nm_device_controller_check_port_physical_port(device, port, LOGD_TEAM); if (configure) { nm_device_take_down(port, TRUE); @@ -882,9 +882,9 @@ attach_port(NMDevice *device, return FALSE; } } - success = nm_platform_link_enslave(nm_device_get_platform(device), - nm_device_get_ip_ifindex(device), - nm_device_get_ip_ifindex(port)); + success = nm_platform_link_attach_port(nm_device_get_platform(device), + nm_device_get_ip_ifindex(device), + nm_device_get_ip_ifindex(port)); nm_device_bring_up(port); if (!success) @@ -928,9 +928,9 @@ detach_port(NMDevice *device, if (ifindex_port <= 0) { _LOGD(LOGD_TEAM, "team port %s is already detached", port_iface); } else if (do_release) { - success = nm_platform_link_release(nm_device_get_platform(device), - nm_device_get_ip_ifindex(device), - ifindex_port); + success = nm_platform_link_release_port(nm_device_get_platform(device), + nm_device_get_ip_ifindex(device), + ifindex_port); if (success) _LOGI(LOGD_TEAM, "detached team port %s", port_iface); else @@ -1128,12 +1128,12 @@ nm_device_team_class_init(NMDeviceTeamClass *klass) device_class->connection_type_check_compatible = NM_SETTING_TEAM_SETTING_NAME; device_class->link_types = NM_DEVICE_DEFINE_LINK_TYPES(NM_LINK_TYPE_TEAM); - device_class->is_controller = TRUE; - device_class->create_and_realize = create_and_realize; - device_class->get_generic_capabilities = get_generic_capabilities; - device_class->complete_connection = complete_connection; - device_class->update_connection = update_connection; - device_class->controller_update_slave_connection = controller_update_slave_connection; + device_class->is_controller = TRUE; + device_class->create_and_realize = create_and_realize; + device_class->get_generic_capabilities = get_generic_capabilities; + device_class->complete_connection = complete_connection; + device_class->update_connection = update_connection; + device_class->controller_update_port_connection = controller_update_port_connection; device_class->act_stage1_prepare_also_for_external_or_assume = TRUE; device_class->act_stage1_prepare = act_stage1_prepare; diff --git a/src/core/nm-active-connection.c b/src/core/nm-active-connection.c index 8439d3bdb..03ee020fb 100644 --- a/src/core/nm-active-connection.c +++ b/src/core/nm-active-connection.c @@ -158,11 +158,11 @@ static NM_UTILS_FLAGS2STR_DEFINE( NMActivationStateFlags, NM_UTILS_FLAGS2STR(NM_ACTIVATION_STATE_FLAG_NONE, "none"), NM_UTILS_FLAGS2STR(NM_ACTIVATION_STATE_FLAG_IS_MASTER, "is-controller"), - NM_UTILS_FLAGS2STR(NM_ACTIVATION_STATE_FLAG_IS_SLAVE, "is-slave"), + NM_UTILS_FLAGS2STR(NM_ACTIVATION_STATE_FLAG_IS_SLAVE, "is-port"), NM_UTILS_FLAGS2STR(NM_ACTIVATION_STATE_FLAG_LAYER2_READY, "layer2-ready"), NM_UTILS_FLAGS2STR(NM_ACTIVATION_STATE_FLAG_IP4_READY, "ip4-ready"), NM_UTILS_FLAGS2STR(NM_ACTIVATION_STATE_FLAG_IP6_READY, "ip6-ready"), - NM_UTILS_FLAGS2STR(NM_ACTIVATION_STATE_FLAG_MASTER_HAS_SLAVES, "controller-has-slaves"), + NM_UTILS_FLAGS2STR(NM_ACTIVATION_STATE_FLAG_MASTER_HAS_SLAVES, "controller-has-ports"), NM_UTILS_FLAGS2STR(NM_ACTIVATION_STATE_FLAG_LIFETIME_BOUND_TO_PROFILE_VISIBILITY, "lifetime-bound-to-profile-visibility"), NM_UTILS_FLAGS2STR(NM_ACTIVATION_STATE_FLAG_EXTERNAL, "external"), ); @@ -444,7 +444,7 @@ _set_applied_connection_take(NMActiveConnection *self, NMConnection *applied_con priv->applied_connection = applied_connection; nm_connection_clear_secrets(priv->applied_connection); - /* we determine whether the connection is a controller/slave, based solely + /* we determine whether the connection is a controller/port, based solely * on the connection properties itself. */ s_con = nm_connection_get_setting_connection(priv->applied_connection); if (nm_setting_connection_get_controller(s_con)) @@ -778,7 +778,7 @@ check_controller_ready(NMActiveConnection *self) /* ActiveConnetions don't enter the ACTIVATING state until they have a * NMDevice in PREPARE or higher states, so the controller active connection's - * device will be ready to accept slaves when the controller is in ACTIVATING + * device will be ready to accept ports when the controller is in ACTIVATING * or higher states. */ if (!priv->controller_ready && priv->controller diff --git a/src/core/nm-config-data.c b/src/core/nm-config-data.c index fd69afd75..0a73695a1 100644 --- a/src/core/nm-config-data.c +++ b/src/core/nm-config-data.c @@ -384,7 +384,7 @@ nm_config_data_get_iwd_config_path(const NMConfigData *self) gboolean nm_config_data_get_ignore_carrier_for_port(const NMConfigData *self, const char *controller, - const char *slave_type) + const char *port_type) { const char *value; gboolean has_match; @@ -393,7 +393,7 @@ nm_config_data_get_ignore_carrier_for_port(const NMConfigData *self, g_return_val_if_fail(NM_IS_CONFIG_DATA(self), FALSE); - if (!controller || !slave_type) + if (!controller || !port_type) goto out_default; if (!nm_utils_ifname_valid_kernel(controller, NULL)) @@ -401,7 +401,7 @@ nm_config_data_get_ignore_carrier_for_port(const NMConfigData *self, match_data = (NMMatchSpecDeviceData){ .interface_name = controller, - .device_type = slave_type, + .device_type = port_type, }; value = _config_data_get_device_config(self, diff --git a/src/core/nm-config-data.h b/src/core/nm-config-data.h index e8447edc2..1ea0ccf25 100644 --- a/src/core/nm-config-data.h +++ b/src/core/nm-config-data.h @@ -189,7 +189,7 @@ gboolean nm_config_data_get_systemd_resolved(const NMConfigData *self); gboolean nm_config_data_get_ignore_carrier_for_port(const NMConfigData *self, const char *controller, - const char *slave_type); + const char *port_type); gboolean nm_config_data_get_ignore_carrier_by_device(const NMConfigData *self, NMDevice *device); gboolean nm_config_data_get_assume_ipv6ll_only(const NMConfigData *self, NMDevice *device); diff --git a/src/core/nm-l3-config-data.c b/src/core/nm-l3-config-data.c index ea48c3877..03c66ce01 100644 --- a/src/core/nm-l3-config-data.c +++ b/src/core/nm-l3-config-data.c @@ -3082,7 +3082,7 @@ nm_l3_config_data_new_from_platform(NMDedupMultiIndex *multi_idx, nm_assert(NM_IS_PLATFORM(platform)); nm_assert(ifindex > 0); - /* Slaves have no IP configuration */ + /* Ports have no IP configuration */ if (nm_platform_link_get_controller(platform, ifindex) > 0) return NULL; diff --git a/src/core/nm-manager.c b/src/core/nm-manager.c index d889ba579..21da89c89 100644 --- a/src/core/nm-manager.c +++ b/src/core/nm-manager.c @@ -1908,11 +1908,11 @@ find_device_by_ip_iface(NMManager *self, const char *iface) * @self: the #NMManager * @iface: the device interface to find * @connection: a connection to ensure the returned device is compatible with - * @slave: a slave connection to ensure a controller is compatible with + * @port: a port connection to ensure a controller is compatible with * - * Finds a device by interface name, preferring realized devices. If @slave + * Finds a device by interface name, preferring realized devices. If @port * is given, this function will only return controller devices and will ensure - * @slave, when activated, can be a slave of the returned controller device. If + * @port, when activated, can be a port of the returned controller device. If * @connection is given, this function will only consider devices that are * compatible with @connection. If @child is given, this function will only * return parent device. @@ -1923,7 +1923,7 @@ static NMDevice * find_device_by_iface(NMManager *self, const char *iface, NMConnection *connection, - NMConnection *slave, + NMConnection *port, NMConnection *child) { NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE(self); @@ -1937,10 +1937,10 @@ find_device_by_iface(NMManager *self, continue; if (connection && !nm_device_check_connection_compatible(candidate, connection, TRUE, NULL)) continue; - if (slave) { + if (port) { if (!nm_device_is_controller(candidate)) continue; - if (!nm_device_check_slave_connection_compatible(candidate, slave)) + if (!nm_device_check_port_connection_compatible(candidate, port)) continue; } if (child && !nm_device_can_be_parent(candidate)) @@ -2348,7 +2348,7 @@ remove_device(NMManager *self, NMDevice *device, gboolean quitting) _emit_device_added_removed(self, device, FALSE); } else { - /* unrealize() does not release a slave device from controller and + /* unrealize() does not release a port device from controller and * clear IP configurations, do it here */ nm_device_removed(device, TRUE); } @@ -3371,7 +3371,7 @@ get_existing_connection(NMManager *self, NMDevice *device, gboolean *out_generat int controller_ifindex = nm_platform_link_get_controller(priv->platform, ifindex); /* Check that the controller is activating before assuming a - * slave connection. However, ignore ovs-system/ovs-netdev controller as + * port connection. However, ignore ovs-system/ovs-netdev controller as * we never manage it. */ if (controller_ifindex @@ -3382,7 +3382,7 @@ get_existing_connection(NMManager *self, NMDevice *device, gboolean *out_generat _LOG2D(LOGD_DEVICE, device, "assume: don't assume because " - "cannot generate connection for slave before its controller (%s/%d)", + "cannot generate connection for port before its controller (%s/%d)", nm_platform_link_get_name(priv->platform, controller_ifindex), controller_ifindex); return NULL; @@ -3391,7 +3391,7 @@ get_existing_connection(NMManager *self, NMDevice *device, gboolean *out_generat _LOG2D(LOGD_DEVICE, device, "assume: don't assume because " - "cannot generate connection for slave before controller %s activates", + "cannot generate connection for port before controller %s activates", nm_device_get_iface(controller)); return NULL; } @@ -3771,7 +3771,7 @@ recheck_assume_connection(NMManager *self, NMDevice *device) return FALSE; } - /* If the device is a slave or VLAN, find the controller ActiveConnection */ + /* If the device is a port or VLAN, find the controller ActiveConnection */ controller_ac = NULL; if (find_controller(self, nm_settings_connection_get_connection(sett_conn), @@ -4863,14 +4863,14 @@ impl_manager_get_device_by_ip_iface(NMDBusObject *obj, } static gboolean -is_compatible_with_slave(NMConnection *controller, NMConnection *slave) +is_compatible_with_port(NMConnection *controller, NMConnection *port) { NMSettingConnection *s_con; g_return_val_if_fail(controller, FALSE); - g_return_val_if_fail(slave, FALSE); + g_return_val_if_fail(port, FALSE); - s_con = nm_connection_get_setting_connection(slave); + s_con = nm_connection_get_setting_connection(port); g_assert(s_con); return nm_connection_is_type(controller, nm_setting_connection_get_port_type(s_con)); @@ -4957,7 +4957,7 @@ find_controller(NMManager *self, NMDevice *device_candidate; if (nm_streq(nm_connection_get_uuid(controller_candidate), controller)) { - if (!is_compatible_with_slave(controller_candidate, connection)) { + if (!is_compatible_with_port(controller_candidate, connection)) { g_set_error(error, NM_MANAGER_ERROR, NM_MANAGER_ERROR_DEPENDENCY_FAILED, @@ -4978,7 +4978,7 @@ find_controller(NMManager *self, } else if (nm_connection_get_interface_name(controller_candidate) && nm_streq(nm_connection_get_interface_name(controller_candidate), controller)) { - if (!is_compatible_with_slave(controller_candidate, connection)) + if (!is_compatible_with_port(controller_candidate, connection)) continue; /* This might be good enough unless we find a better one (already active or UUID match) */ @@ -5134,8 +5134,8 @@ ensure_controller_active_connection(NMManager *self, */ g_assert(!controller_connection || controller_connection == device_connection); if (device_connection - && !is_compatible_with_slave(nm_settings_connection_get_connection(device_connection), - connection)) { + && !is_compatible_with_port(nm_settings_connection_get_connection(device_connection), + connection)) { g_set_error(error, NM_MANAGER_ERROR, NM_MANAGER_ERROR_DEPENDENCY_FAILED, @@ -5177,10 +5177,10 @@ ensure_controller_active_connection(NMManager *self, NMSettingsConnection *candidate = connections[i]; NMConnection *cand_conn = nm_settings_connection_get_connection(candidate); - /* Ensure eg bond/team slave and the candidate controller is a + /* Ensure eg bond/team port and the candidate controller is a * bond/team controller */ - if (!is_compatible_with_slave(cand_conn, connection)) + if (!is_compatible_with_port(cand_conn, connection)) continue; if (nm_device_check_connection_available( @@ -5271,37 +5271,37 @@ ensure_controller_active_connection(NMManager *self, typedef struct { NMSettingsConnection *connection; NMDevice *device; -} SlaveConnectionInfo; +} PortConnectionInfo; /** - * find_slaves: + * find_ports: * @manager: #NMManager object - * @sett_conn: the controller #NMSettingsConnection to find slave connections for + * @sett_conn: the controller #NMSettingsConnection to find port connections for * @device: the controller #NMDevice for the @sett_conn - * @out_n_slaves: on return, the number of slaves found + * @out_n_ports: on return, the number of ports found * - * Given an #NMSettingsConnection, attempts to find its slaves. If @sett_conn is not - * controller, or has not any slaves, this will return %NULL. + * Given an #NMSettingsConnection, attempts to find its ports. If @sett_conn is not + * controller, or has not any ports, this will return %NULL. * - * Returns: an array of #SlaveConnectionInfo for given controller @sett_conn, or %NULL + * Returns: an array of #PortConnectionInfo for given controller @sett_conn, or %NULL **/ -static SlaveConnectionInfo * -find_slaves(NMManager *manager, - NMSettingsConnection *sett_conn, - NMDevice *device, - guint *out_n_slaves, - gboolean for_user_request) +static PortConnectionInfo * +find_ports(NMManager *manager, + NMSettingsConnection *sett_conn, + NMDevice *device, + guint *out_n_ports, + gboolean for_user_request) { NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE(manager); NMSettingsConnection *const *all_connections = NULL; guint n_all_connections; guint i; - SlaveConnectionInfo *slaves = NULL; - guint n_slaves = 0; + PortConnectionInfo *ports = NULL; + guint n_ports = 0; NMSettingConnection *s_con; gs_unref_hashtable GHashTable *devices = NULL; - nm_assert(out_n_slaves); + nm_assert(out_n_ports); s_con = nm_connection_get_setting_connection(nm_settings_connection_get_connection(sett_conn)); g_return_val_if_fail(s_con, NULL); @@ -5309,7 +5309,7 @@ find_slaves(NMManager *manager, devices = g_hash_table_new(nm_direct_hash, NULL); /* Search through all connections, not only inactive ones, because - * even if a slave was already active, it might be deactivated during + * even if a port was already active, it might be deactivated during * controller reactivation. */ all_connections = @@ -5318,7 +5318,7 @@ find_slaves(NMManager *manager, for (i = 0; i < n_all_connections; i++) { NMSettingsConnection *controller_connection = NULL; NMDevice *controller_device = NULL; - NMDevice *slave_device; + NMDevice *port_device; NMSettingsConnection *candidate = all_connections[i]; find_controller(manager, @@ -5330,38 +5330,38 @@ find_slaves(NMManager *manager, NULL); if ((controller_connection && controller_connection == sett_conn) || (controller_device && controller_device == device)) { - slave_device = nm_manager_get_best_device_for_connection(manager, - candidate, - NULL, - for_user_request, - devices, - NULL); + port_device = nm_manager_get_best_device_for_connection(manager, + candidate, + NULL, + for_user_request, + devices, + NULL); - if (!slaves) { + if (!ports) { /* what we allocate is quite likely much too large. Don't bother, it is only * a temporary buffer. */ - slaves = g_new(SlaveConnectionInfo, n_all_connections); + ports = g_new(PortConnectionInfo, n_all_connections); } - nm_assert(n_slaves < n_all_connections); - slaves[n_slaves++] = (SlaveConnectionInfo){ + nm_assert(n_ports < n_all_connections); + ports[n_ports++] = (PortConnectionInfo){ .connection = candidate, - .device = slave_device, + .device = port_device, }; - if (slave_device) - g_hash_table_add(devices, slave_device); + if (port_device) + g_hash_table_add(devices, port_device); } } - *out_n_slaves = n_slaves; + *out_n_ports = n_ports; - /* Warning: returns NULL if n_slaves is zero. */ - return slaves; + /* Warning: returns NULL if n_ports is zero. */ + return ports; } static gboolean -should_connect_slaves(NMConnection *connection, NMDevice *device) +should_connect_ports(NMConnection *connection, NMDevice *device) { NMSettingConnection *s_con; NMTernary val; @@ -5390,12 +5390,12 @@ out: } static int -compare_slaves(gconstpointer a, gconstpointer b) +compare_ports(gconstpointer a, gconstpointer b) { - const SlaveConnectionInfo *a_info = a; - const SlaveConnectionInfo *b_info = b; + const PortConnectionInfo *a_info = a; + const PortConnectionInfo *b_info = b; - /* Slaves without a device at the end */ + /* Ports without a device at the end */ if (!a_info->device) return 1; if (!b_info->device) @@ -5405,50 +5405,47 @@ compare_slaves(gconstpointer a, gconstpointer b) } static void -autoconnect_slaves(NMManager *self, - NMSettingsConnection *controller_connection, - NMDevice *controller_device, - NMAuthSubject *subject, - gboolean for_user_request) +autoconnect_ports(NMManager *self, + NMSettingsConnection *controller_connection, + NMDevice *controller_device, + NMAuthSubject *subject, + gboolean for_user_request) { GError *local_err = NULL; - if (should_connect_slaves(nm_settings_connection_get_connection(controller_connection), - controller_device)) { - gs_free SlaveConnectionInfo *slaves = NULL; - guint i, n_slaves = 0; - gboolean bind_lifetime_to_profile_visibility; + if (should_connect_ports(nm_settings_connection_get_connection(controller_connection), + controller_device)) { + gs_free PortConnectionInfo *ports = NULL; + guint i, n_ports = 0; + gboolean bind_lifetime_to_profile_visibility; - slaves = find_slaves(self, - controller_connection, - controller_device, - &n_slaves, - for_user_request); - if (n_slaves > 1) { - qsort(slaves, n_slaves, sizeof(slaves[0]), compare_slaves); + ports = + find_ports(self, controller_connection, controller_device, &n_ports, for_user_request); + if (n_ports > 1) { + qsort(ports, n_ports, sizeof(ports[0]), compare_ports); } bind_lifetime_to_profile_visibility = - n_slaves > 0 + n_ports > 0 && NM_FLAGS_HAS(nm_device_get_activation_state_flags(controller_device), NM_ACTIVATION_STATE_FLAG_LIFETIME_BOUND_TO_PROFILE_VISIBILITY); - for (i = 0; i < n_slaves; i++) { - SlaveConnectionInfo *slave = &slaves[i]; - const char *uuid; + for (i = 0; i < n_ports; i++) { + PortConnectionInfo *port = &ports[i]; + const char *uuid; - /* To avoid loops when autoconnecting slaves, we propagate - * the UUID of the initial connection down to slaves until + /* To avoid loops when autoconnecting ports, we propagate + * the UUID of the initial connection down to ports until * the same connection is found. */ uuid = g_object_get_qdata(G_OBJECT(controller_connection), autoconnect_root_quark()); - if (nm_streq0(nm_settings_connection_get_uuid(slave->connection), uuid)) { + if (nm_streq0(nm_settings_connection_get_uuid(port->connection), uuid)) { _LOGI(LOGD_CORE, - "will NOT activate slave connection '%s' (%s) as a dependency for controller " + "will NOT activate port connection '%s' (%s) as a dependency for controller " "'%s' (%s): " "circular dependency detected", - nm_settings_connection_get_id(slave->connection), - nm_settings_connection_get_uuid(slave->connection), + nm_settings_connection_get_id(port->connection), + nm_settings_connection_get_uuid(port->connection), nm_settings_connection_get_id(controller_connection), nm_settings_connection_get_uuid(controller_connection)); continue; @@ -5456,18 +5453,18 @@ autoconnect_slaves(NMManager *self, if (!uuid) uuid = nm_settings_connection_get_uuid(controller_connection); - g_object_set_qdata_full(G_OBJECT(slave->connection), + g_object_set_qdata_full(G_OBJECT(port->connection), autoconnect_root_quark(), g_strdup(uuid), g_free); - if (!slave->device) { + if (!port->device) { _LOGD(LOGD_CORE, - "will NOT activate slave connection '%s' (%s) as a dependency for controller " + "will NOT activate port connection '%s' (%s) as a dependency for controller " "'%s' (%s): " "no compatible device found", - nm_settings_connection_get_id(slave->connection), - nm_settings_connection_get_uuid(slave->connection), + nm_settings_connection_get_id(port->connection), + nm_settings_connection_get_uuid(port->connection), nm_settings_connection_get_id(controller_connection), nm_settings_connection_get_uuid(controller_connection)); continue; @@ -5475,28 +5472,28 @@ autoconnect_slaves(NMManager *self, _LOGD( LOGD_CORE, - "will activate slave connection '%s' (%s) as a dependency for controller '%s' (%s)", - nm_settings_connection_get_id(slave->connection), - nm_settings_connection_get_uuid(slave->connection), + "will activate port connection '%s' (%s) as a dependency for controller '%s' (%s)", + nm_settings_connection_get_id(port->connection), + nm_settings_connection_get_uuid(port->connection), nm_settings_connection_get_id(controller_connection), nm_settings_connection_get_uuid(controller_connection)); - /* Schedule slave activation */ + /* Schedule port activation */ nm_manager_activate_connection( self, - slave->connection, + port->connection, NULL, NULL, - slave->device, + port->device, subject, NM_ACTIVATION_TYPE_MANAGED, - NM_ACTIVATION_REASON_AUTOCONNECT_SLAVES, + NM_ACTIVATION_REASON_AUTOCONNECT_PORTS, bind_lifetime_to_profile_visibility ? NM_ACTIVATION_STATE_FLAG_LIFETIME_BOUND_TO_PROFILE_VISIBILITY : NM_ACTIVATION_STATE_FLAG_NONE, &local_err); if (local_err) { - _LOGW(LOGD_CORE, "Slave connection activation failed: %s", local_err->message); + _LOGW(LOGD_CORE, "Port connection activation failed: %s", local_err->message); g_clear_error(&local_err); } } @@ -5905,9 +5902,9 @@ _internal_activate_device(NMManager *self, NMActiveConnection *active, GError ** nm_device_get_ip_iface(controller_device)); } - /* Ensure eg bond slave and the candidate controller is a bond controller */ + /* Ensure eg bond port and the candidate controller is a bond controller */ if (controller_connection - && !is_compatible_with_slave( + && !is_compatible_with_port( nm_settings_connection_get_connection(controller_connection), applied)) { g_set_error(error, @@ -5943,8 +5940,8 @@ _internal_activate_device(NMManager *self, NMActiveConnection *active, GError ** } } - /* Now that we're activating a slave for that controller, make sure the controller just - * decides to go unmanaged while we're activating (perhaps because other slaves + /* Now that we're activating a port for that controller, make sure the controller just + * decides to go unmanaged while we're activating (perhaps because other ports * go away leaving him with no kids). */ if (controller_device) { @@ -5982,13 +5979,13 @@ _internal_activate_device(NMManager *self, NMActiveConnection *active, GError ** } } - /* Check slaves for controller connection and possibly activate them */ - autoconnect_slaves(self, - sett_conn, - device, - nm_active_connection_get_subject(active), - nm_active_connection_get_activation_reason(active) - == NM_ACTIVATION_REASON_USER_REQUEST); + /* Check ports for controller connection and possibly activate them */ + autoconnect_ports(self, + sett_conn, + device, + nm_active_connection_get_subject(active), + nm_active_connection_get_activation_reason(active) + == NM_ACTIVATION_REASON_USER_REQUEST); multi_connect = _nm_connection_get_multi_connect(nm_settings_connection_get_connection(sett_conn)); @@ -5996,7 +5993,7 @@ _internal_activate_device(NMManager *self, NMActiveConnection *active, GError ** || (multi_connect == NM_CONNECTION_MULTI_CONNECT_MANUAL_MULTIPLE && NM_IN_SET(nm_active_connection_get_activation_reason(active), NM_ACTIVATION_REASON_ASSUME, - NM_ACTIVATION_REASON_AUTOCONNECT_SLAVES, + NM_ACTIVATION_REASON_AUTOCONNECT_PORTS, NM_ACTIVATION_REASON_USER_REQUEST))) { /* the profile can be activated multiple times. Proceed. */ } else { @@ -6347,8 +6344,8 @@ nm_manager_activate_connection(NMManager *self, /* Look for a active connection that's equivalent and is already pending authorization * and eventual activation. This is used to de-duplicate concurrent activations which would * otherwise race and cause the device to disconnect and reconnect repeatedly. - * In particular, this allows the controller and multiple slaves to concurrently auto-activate - * while all the slaves would use the same active-connection. */ + * In particular, this allows the controller and multiple ports to concurrently auto-activate + * while all the ports would use the same active-connection. */ c_list_for_each_entry (async_op_data, &priv->async_op_lst_head, async_op_lst) { if (async_op_data->async_op_type != ASYNC_OP_TYPE_AC_AUTH_ACTIVATE_INTERNAL) continue; diff --git a/src/core/nm-policy.c b/src/core/nm-policy.c index d42e56a93..c9561aebd 100644 --- a/src/core/nm-policy.c +++ b/src/core/nm-policy.c @@ -1869,16 +1869,15 @@ unblock_autoconnect_for_ports(NMPolicy *self, connections = nm_settings_get_connections(priv->settings, NULL); for (i = 0; connections[i]; i++) { NMSettingsConnection *sett_conn = connections[i]; - NMSettingConnection *s_slave_con; - const char *slave_controller; + NMSettingConnection *s_port_con; + const char *port_controller; - s_slave_con = - nm_settings_connection_get_setting(sett_conn, NM_META_SETTING_TYPE_CONNECTION); - slave_controller = nm_setting_connection_get_controller(s_slave_con); - if (!slave_controller) + s_port_con = nm_settings_connection_get_setting(sett_conn, NM_META_SETTING_TYPE_CONNECTION); + port_controller = nm_setting_connection_get_controller(s_port_con); + if (!port_controller) continue; - if (!NM_IN_STRSET(slave_controller, + if (!NM_IN_STRSET(port_controller, controller_device, controller_uuid_applied, controller_uuid_settings)) diff --git a/src/core/nm-types.h b/src/core/nm-types.h index 6dfdc8e24..907da0bb8 100644 --- a/src/core/nm-types.h +++ b/src/core/nm-types.h @@ -68,7 +68,7 @@ typedef enum { NM_ACTIVATION_REASON_EXTERNAL, NM_ACTIVATION_REASON_ASSUME, NM_ACTIVATION_REASON_AUTOCONNECT, - NM_ACTIVATION_REASON_AUTOCONNECT_SLAVES, + NM_ACTIVATION_REASON_AUTOCONNECT_PORTS, NM_ACTIVATION_REASON_USER_REQUEST, } NMActivationReason; diff --git a/src/core/platform/nm-fake-platform.c b/src/core/platform/nm-fake-platform.c index ceb4fc55d..6a64746e4 100644 --- a/src/core/platform/nm-fake-platform.c +++ b/src/core/platform/nm-fake-platform.c @@ -199,14 +199,14 @@ link_add_prepare(NMPlatform *platform, NMFakePlatformLink *device, NMPObject *ob if (NM_FLAGS_HAS(obj_tmp->link.n_ifi_flags, IFF_UP)) { NMPLookup lookup; NMDedupMultiIter iter; - const NMPObject *slave_candidate = NULL; + const NMPObject *port_candidate = NULL; nmp_cache_iter_for_each ( &iter, nmp_cache_lookup(nm_platform_get_cache(platform), nmp_lookup_init_obj_type(&lookup, NMP_OBJECT_TYPE_LINK)), - &slave_candidate) { - if (nmp_cache_link_connected_for_slave(obj_tmp->link.ifindex, slave_candidate)) { + &port_candidate) { + if (nmp_cache_link_connected_for_port(obj_tmp->link.ifindex, port_candidate)) { connected = TRUE; break; } @@ -736,9 +736,9 @@ link_change(NMPlatform *platform, } static gboolean -link_enslave(NMPlatform *platform, int controller, int slave) +link_attach_port(NMPlatform *platform, int controller, int port) { - NMFakePlatformLink *device = link_get(platform, slave); + NMFakePlatformLink *device = link_get(platform, port); NMFakePlatformLink *controller_device = link_get(platform, controller); g_return_val_if_fail(device, FALSE); @@ -758,21 +758,21 @@ link_enslave(NMPlatform *platform, int controller, int slave) } static gboolean -link_release(NMPlatform *platform, int controller_idx, int slave_idx) +link_release_port(NMPlatform *platform, int controller_idx, int port_idx) { NMFakePlatformLink *controller = link_get(platform, controller_idx); - NMFakePlatformLink *slave = link_get(platform, slave_idx); + NMFakePlatformLink *port = link_get(platform, port_idx); nm_auto_nmpobj NMPObject *obj_tmp = NULL; g_return_val_if_fail(controller, FALSE); - g_return_val_if_fail(slave, FALSE); + g_return_val_if_fail(port, FALSE); - if (slave->obj->link.controller != controller->obj->link.ifindex) + if (port->obj->link.controller != controller->obj->link.ifindex) return FALSE; - obj_tmp = nmp_object_clone(slave->obj, FALSE); + obj_tmp = nmp_object_clone(port->obj, FALSE); obj_tmp->link.controller = 0; - link_set_obj(platform, slave, obj_tmp); + link_set_obj(platform, port, obj_tmp); return TRUE; } @@ -1438,8 +1438,8 @@ nm_fake_platform_class_init(NMFakePlatformClass *klass) platform_class->link_supports_vlans = link_supports_vlans; platform_class->link_supports_sriov = link_supports_sriov; - platform_class->link_enslave = link_enslave; - platform_class->link_release = link_release; + platform_class->link_attach_port = link_attach_port; + platform_class->link_release_port = link_release_port; platform_class->link_vlan_change = link_vlan_change; diff --git a/src/core/platform/tests/test-link.c b/src/core/platform/tests/test-link.c index afa8c3ddd..9f63b896a 100644 --- a/src/core/platform/tests/test-link.c +++ b/src/core/platform/tests/test-link.c @@ -27,7 +27,7 @@ #define DUMMY_TYPEDESC "dummy" #define BOGUS_NAME "nm-bogus-device" #define BOGUS_IFINDEX INT_MAX -#define SLAVE_NAME "nm-test-slave" +#define PORT_NAME "nm-test-port" #define PARENT_NAME "nm-test-parent" #define VLAN_ID 4077 #define VLAN_FLAGS 0 @@ -228,7 +228,7 @@ test_port(int controller, int port_type, SignalData *controller_changed) SignalData *link_added = add_signal_ifname(NM_PLATFORM_SIGNAL_LINK_CHANGED, NM_PLATFORM_SIGNAL_ADDED, link_callback, - SLAVE_NAME); + PORT_NAME); SignalData *link_changed, *link_removed; NMLinkType controller_type = nm_platform_link_get_type(NM_PLATFORM_GET, controller); gboolean test_link_changed_signal_arg1; @@ -236,8 +236,8 @@ test_port(int controller, int port_type, SignalData *controller_changed) g_assert(NM_IN_SET(controller_type, NM_LINK_TYPE_TEAM, NM_LINK_TYPE_BOND, NM_LINK_TYPE_BRIDGE)); - g_assert(software_add(port_type, SLAVE_NAME)); - ifindex_port = nm_platform_link_get_ifindex(NM_PLATFORM_GET, SLAVE_NAME); + g_assert(software_add(port_type, PORT_NAME)); + ifindex_port = nm_platform_link_get_ifindex(NM_PLATFORM_GET, PORT_NAME); g_assert(ifindex_port > 0); link_changed = add_signal_ifindex(NM_PLATFORM_SIGNAL_LINK_CHANGED, NM_PLATFORM_SIGNAL_CHANGED, @@ -260,7 +260,7 @@ test_port(int controller, int port_type, SignalData *controller_changed) /* Attach port */ link_changed->ifindex = ifindex_port; - g_assert(nm_platform_link_enslave(NM_PLATFORM_GET, controller, ifindex_port)); + g_assert(nm_platform_link_attach_port(NM_PLATFORM_GET, controller, ifindex_port)); g_assert_cmpint(nm_platform_link_get_controller(NM_PLATFORM_GET, ifindex_port), ==, controller); accept_signals(link_changed, 1, 3); @@ -279,7 +279,7 @@ test_port(int controller, int port_type, SignalData *controller_changed) const NMPlatformLink *link; const NMPlatformLnkBond *lnk; - link = nmtstp_link_get_typed(NM_PLATFORM_GET, 0, SLAVE_NAME, NM_LINK_TYPE_DUMMY); + link = nmtstp_link_get_typed(NM_PLATFORM_GET, 0, PORT_NAME, NM_LINK_TYPE_DUMMY); g_assert(link); lnk = nm_platform_link_get_lnk_bond(NM_PLATFORM_GET, controller, NULL); @@ -298,7 +298,7 @@ test_port(int controller, int port_type, SignalData *controller_changed) g_assert(nm_platform_link_change(NM_PLATFORM_GET, ifindex_port, NULL, &bond_port, NULL, 0)); accept_signals(link_changed, 1, 3); - link = nmtstp_link_get(NM_PLATFORM_GET, ifindex_port, SLAVE_NAME); + link = nmtstp_link_get(NM_PLATFORM_GET, ifindex_port, PORT_NAME); g_assert(link); g_assert_cmpint(link->port_data.bond.queue_id, ==, 5); g_assert(link->port_data.bond.prio_has || link->port_data.bond.prio == 0); @@ -309,7 +309,7 @@ test_port(int controller, int port_type, SignalData *controller_changed) const NMPlatformLink *link; const NMPlatformLnkBridge *lnk; - link = nmtstp_link_get_typed(NM_PLATFORM_GET, 0, SLAVE_NAME, NM_LINK_TYPE_DUMMY); + link = nmtstp_link_get_typed(NM_PLATFORM_GET, 0, PORT_NAME, NM_LINK_TYPE_DUMMY); g_assert(link); lnk = nm_platform_link_get_lnk_bridge(NM_PLATFORM_GET, controller, NULL); @@ -329,7 +329,7 @@ test_port(int controller, int port_type, SignalData *controller_changed) 0)); accept_signals(link_changed, 1, 3); - link = nmtstp_link_get(NM_PLATFORM_GET, ifindex_port, SLAVE_NAME); + link = nmtstp_link_get(NM_PLATFORM_GET, ifindex_port, PORT_NAME); g_assert(link); g_assert_cmpint(link->port_data.bridge.path_cost, ==, 100); g_assert_cmpint(link->port_data.bridge.priority, ==, 614); @@ -415,7 +415,7 @@ test_port(int controller, int port_type, SignalData *controller_changed) * Gracefully succeed if already attached port. */ ensure_no_signal(link_changed); - g_assert(nm_platform_link_enslave(NM_PLATFORM_GET, controller, ifindex_port)); + g_assert(nm_platform_link_attach_port(NM_PLATFORM_GET, controller, ifindex_port)); accept_signals(link_changed, 0, 2); accept_signals(controller_changed, 0, 2); @@ -423,7 +423,7 @@ test_port(int controller, int port_type, SignalData *controller_changed) ensure_no_signal(link_added); ensure_no_signal(link_changed); ensure_no_signal(link_removed); - g_assert(nm_platform_link_release(NM_PLATFORM_GET, controller, ifindex_port)); + g_assert(nm_platform_link_release_port(NM_PLATFORM_GET, controller, ifindex_port)); g_assert_cmpint(nm_platform_link_get_controller(NM_PLATFORM_GET, ifindex_port), ==, 0); if (link_changed->received_count > 0) { accept_signals(link_added, 0, 1); @@ -442,7 +442,7 @@ test_port(int controller, int port_type, SignalData *controller_changed) /* Release again */ ensure_no_signal(link_changed); - g_assert(!nm_platform_link_release(NM_PLATFORM_GET, controller, ifindex_port)); + g_assert(!nm_platform_link_release_port(NM_PLATFORM_GET, controller, ifindex_port)); ensure_no_signal(controller_changed); @@ -550,7 +550,7 @@ test_software(NMLinkType link_type, const char *link_typename) } } - /* Enslave and release */ + /* Attach port and release */ switch (link_type) { case NM_LINK_TYPE_BRIDGE: case NM_LINK_TYPE_BOND: @@ -4065,10 +4065,10 @@ void _nmtstp_setup_tests(void) { nmtstp_link_delete(NM_PLATFORM_GET, -1, -1, DEVICE_NAME, FALSE); - nmtstp_link_delete(NM_PLATFORM_GET, -1, -1, SLAVE_NAME, FALSE); + nmtstp_link_delete(NM_PLATFORM_GET, -1, -1, PORT_NAME, FALSE); nmtstp_link_delete(NM_PLATFORM_GET, -1, -1, PARENT_NAME, FALSE); g_assert(!nm_platform_link_get_by_ifname(NM_PLATFORM_GET, DEVICE_NAME)); - g_assert(!nm_platform_link_get_by_ifname(NM_PLATFORM_GET, SLAVE_NAME)); + g_assert(!nm_platform_link_get_by_ifname(NM_PLATFORM_GET, PORT_NAME)); g_assert(!nm_platform_link_get_by_ifname(NM_PLATFORM_GET, PARENT_NAME)); g_test_add_func("/link/bogus", test_bogus); diff --git a/src/core/settings/plugins/ifcfg-rh/nms-ifcfg-rh-reader.c b/src/core/settings/plugins/ifcfg-rh/nms-ifcfg-rh-reader.c index 260086b71..81964de6c 100644 --- a/src/core/settings/plugins/ifcfg-rh/nms-ifcfg-rh-reader.c +++ b/src/core/settings/plugins/ifcfg-rh/nms-ifcfg-rh-reader.c @@ -286,7 +286,7 @@ _cert_set_from_ifcfg(gpointer setting, /*****************************************************************************/ static void -check_if_bond_slave(shvarFile *ifcfg, NMSettingConnection *s_con) +check_if_bond_port(shvarFile *ifcfg, NMSettingConnection *s_con) { gs_free char *value = NULL; const char *v; @@ -299,7 +299,7 @@ check_if_bond_slave(shvarFile *ifcfg, NMSettingConnection *s_con) if (v) { controller = nm_setting_connection_get_controller(s_con); if (controller) { - PARSE_WARNING("Already configured as slave of %s. Ignoring MASTER{_UUID}=\"%s\"", + PARSE_WARNING("Already configured as port of %s. Ignoring MASTER{_UUID}=\"%s\"", controller, v); return; @@ -319,7 +319,7 @@ check_if_bond_slave(shvarFile *ifcfg, NMSettingConnection *s_con) } static void -check_if_team_slave(shvarFile *ifcfg, NMSettingConnection *s_con) +check_if_team_port(shvarFile *ifcfg, NMSettingConnection *s_con) { gs_free char *value = NULL; const char *v; @@ -333,7 +333,7 @@ check_if_team_slave(shvarFile *ifcfg, NMSettingConnection *s_con) controller = nm_setting_connection_get_controller(s_con); if (controller) { - PARSE_WARNING("Already configured as slave of %s. Ignoring TEAM_MASTER{_UUID}=\"%s\"", + PARSE_WARNING("Already configured as port of %s. Ignoring TEAM_MASTER{_UUID}=\"%s\"", controller, v); return; @@ -508,9 +508,7 @@ make_connection_setting(const char *file, const char *old_value; if ((old_value = nm_setting_connection_get_controller(s_con))) { - PARSE_WARNING("Already configured as slave of %s. Ignoring BRIDGE=\"%s\"", - old_value, - v); + PARSE_WARNING("Already configured as port of %s. Ignoring BRIDGE=\"%s\"", old_value, v); } else { g_object_set(s_con, NM_SETTING_CONNECTION_CONTROLLER, v, NULL); g_object_set(s_con, @@ -520,8 +518,8 @@ make_connection_setting(const char *file, } } - check_if_bond_slave(ifcfg, s_con); - check_if_team_slave(ifcfg, s_con); + check_if_bond_port(ifcfg, s_con); + check_if_team_port(ifcfg, s_con); nm_clear_g_free(&value); v = svGetValueStr(ifcfg, "OVS_PORT_UUID", &value); @@ -531,7 +529,7 @@ make_connection_setting(const char *file, const char *old_value; if ((old_value = nm_setting_connection_get_controller(s_con))) { - PARSE_WARNING("Already configured as slave of %s. Ignoring OVS_PORT=\"%s\"", + PARSE_WARNING("Already configured as port of %s. Ignoring OVS_PORT=\"%s\"", old_value, v); } else { @@ -551,7 +549,7 @@ make_connection_setting(const char *file, const char *old_value; if ((old_value = nm_setting_connection_get_controller(s_con))) { - PARSE_WARNING("Already configured as slave of %s. Ignoring VRF{_UUID}=\"%s\"", + PARSE_WARNING("Already configured as port of %s. Ignoring VRF{_UUID}=\"%s\"", old_value, v); } else { diff --git a/src/core/settings/plugins/ifcfg-rh/nms-ifcfg-rh-writer.c b/src/core/settings/plugins/ifcfg-rh/nms-ifcfg-rh-writer.c index 78bf701c1..21f31d8b8 100644 --- a/src/core/settings/plugins/ifcfg-rh/nms-ifcfg-rh-writer.c +++ b/src/core/settings/plugins/ifcfg-rh/nms-ifcfg-rh-writer.c @@ -2194,13 +2194,13 @@ write_connection_setting(NMSettingConnection *s_con, shvarFile *ifcfg, const cha /* Only save the value for controller connections */ type = nm_setting_connection_get_connection_type(s_con); if (_nm_connection_type_is_controller(type)) { - NMSettingConnectionAutoconnectSlaves autoconnect_slaves; - autoconnect_slaves = nm_setting_connection_get_autoconnect_slaves(s_con); + NMTernary autoconnect_ports; + autoconnect_ports = nm_setting_connection_get_autoconnect_ports(s_con); svSetValueStr(ifcfg, "AUTOCONNECT_SLAVES", - autoconnect_slaves == NM_SETTING_CONNECTION_AUTOCONNECT_SLAVES_YES ? "yes" - : autoconnect_slaves == NM_SETTING_CONNECTION_AUTOCONNECT_SLAVES_NO ? "no" - : NULL); + autoconnect_ports == NM_TERNARY_TRUE ? "yes" + : autoconnect_ports == NM_TERNARY_FALSE ? "no" + : NULL); } switch (nm_setting_connection_get_lldp(s_con)) { case NM_SETTING_CONNECTION_LLDP_ENABLE_RX: @@ -2287,7 +2287,7 @@ write_connection_setting(NMSettingConnection *s_con, shvarFile *ifcfg, const cha svSetValueStr(ifcfg, "VRF_UUID", controller); svSetValueStr(ifcfg, "VRF", controller_iface); } else { - _LOGW("don't know how to set controller for a %s slave", + _LOGW("don't know how to set controller for a %s port", nm_setting_connection_get_port_type(s_con)); } } @@ -3056,7 +3056,7 @@ write_ip4_aliases(NMConnection *connection, const char *base_ifcfg_path) s_ip4 = nm_connection_get_setting_ip4_config(connection); if (!s_ip4) { - /* slave-type: no alias files */ + /* port-type: no alias files */ return; } diff --git a/src/core/settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-team-slave-enp31s0f1-142.cexpected b/src/core/settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-team-port-enp31s0f1-142.cexpected similarity index 86% rename from src/core/settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-team-slave-enp31s0f1-142.cexpected rename to src/core/settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-team-port-enp31s0f1-142.cexpected index b01372af2..f79e5a078 100644 --- a/src/core/settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-team-slave-enp31s0f1-142.cexpected +++ b/src/core/settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-team-port-enp31s0f1-142.cexpected @@ -5,7 +5,7 @@ REORDER_HDR=yes GVRP=no MVRP=no HWADDR= -NAME=team-slave-enp31s0f1-142 +NAME=team-port-enp31s0f1-142 UUID=74f435bb-ede4-415a-9d48-f580b60eba04 DEVICE=enp31s0f1-142 ONBOOT=no diff --git a/src/core/settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-bond-slave b/src/core/settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-bond-port-bond0 similarity index 100% rename from src/core/settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-bond-slave rename to src/core/settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-bond-port-bond0 diff --git a/src/core/settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-bond-slave-ib b/src/core/settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-bond-port-ib similarity index 100% rename from src/core/settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-bond-slave-ib rename to src/core/settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-bond-port-ib diff --git a/src/core/settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c b/src/core/settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c index cc709b1d1..334662c36 100644 --- a/src/core/settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c +++ b/src/core/settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c @@ -2221,7 +2221,7 @@ test_clear_controller(void) char *unmanaged = NULL; shvarFile *f; - /* 1. load the bridge slave connection from disk */ + /* 1. load the bridge port connection from disk */ connection = _connection_from_file(TEST_IFCFG_DIR "/ifcfg-test-bridge-component", NULL, TYPE_ETHERNET, @@ -2239,7 +2239,7 @@ test_clear_controller(void) TEST_IFCFG_DIR "/ifcfg-System_test-bridge-component-a.cexpected", &testfile); - /* 3. clear controller and slave-type */ + /* 3. clear controller and port-type */ g_object_set(s_con, NM_SETTING_CONNECTION_MASTER, NULL, @@ -8251,13 +8251,15 @@ test_write_bond_main(void) } static void -test_read_bond_slave(void) +test_read_bond_port(void) { gs_unref_object NMConnection *connection = NULL; NMSettingConnection *s_con; - connection = - _connection_from_file(TEST_IFCFG_DIR "/ifcfg-test-bond-slave", NULL, TYPE_ETHERNET, NULL); + connection = _connection_from_file(TEST_IFCFG_DIR "/ifcfg-test-bond-port-bond0", + NULL, + TYPE_ETHERNET, + NULL); g_test_assert_expected_messages(); s_con = nmtst_connection_assert_setting(connection, NM_TYPE_SETTING_CONNECTION); @@ -8268,7 +8270,7 @@ test_read_bond_slave(void) } static void -test_write_bond_slave(void) +test_write_bond_port(void) { nmtst_auto_unlinkfile char *testfile = NULL; gs_unref_object NMConnection *connection = NULL; @@ -8309,7 +8311,7 @@ test_write_bond_slave(void) } static void -test_read_bond_port(void) +test_read_bond_port_setting(void) { gs_unref_object NMConnection *connection = NULL; NMSettingConnection *s_con = NULL; @@ -8327,7 +8329,7 @@ test_read_bond_port(void) } static void -test_write_bond_port(void) +test_write_bond_port_setting(void) { nmtst_auto_unlinkfile char *testfile = NULL; gs_unref_object NMConnection *connection = NULL; @@ -8548,13 +8550,12 @@ test_write_infiniband(gconstpointer test_data) } static void -test_read_bond_slave_ib(void) +test_read_bond_port_ib(void) { gs_unref_object NMConnection *connection = NULL; NMSettingConnection *s_con; - connection = - _connection_from_file(TEST_IFCFG_DIR "/ifcfg-test-bond-slave-ib", NULL, NULL, NULL); + connection = _connection_from_file(TEST_IFCFG_DIR "/ifcfg-test-bond-port-ib", NULL, NULL, NULL); s_con = nmtst_connection_assert_setting(connection, NM_TYPE_SETTING_CONNECTION); @@ -8563,7 +8564,7 @@ test_read_bond_slave_ib(void) } static void -test_write_bond_slave_ib(void) +test_write_bond_port_ib(void) { nmtst_auto_unlinkfile char *testfile = NULL; gs_unref_object NMConnection *connection = NULL; @@ -9236,7 +9237,7 @@ test_read_team_port_empty_config(void) } static void -test_team_reread_slave(void) +test_team_reread_port(void) { nmtst_auto_unlinkfile char *testfile = NULL; gs_unref_object NMConnection *connection_1 = NULL; @@ -9247,14 +9248,14 @@ test_team_reread_slave(void) connection_1 = nmtst_create_connection_from_keyfile("[connection]\n" - "id=team-slave-enp31s0f1-142\n" + "id=team-port-enp31s0f1-142\n" "uuid=74f435bb-ede4-415a-9d48-f580b60eba04\n" "type=vlan\n" "autoconnect=false\n" "interface-name=enp31s0f1-142\n" "controller=team142\n" "permissions=\n" - "slave-type=team\n" + "port-type=team\n" "\n" "[vlan]\n" "egress-priority-map=\n" @@ -9262,10 +9263,10 @@ test_team_reread_slave(void) "id=142\n" "ingress-priority-map=\n" "parent=enp31s0f1\n", - "/test_team_reread_slave"); + "/test_team_reread_port"); /* to double-check keyfile syntax, re-create the connection by hand. */ - connection_2 = nmtst_create_minimal_connection("team-slave-enp31s0f1-142", + connection_2 = nmtst_create_minimal_connection("team-port-enp31s0f1-142", "74f435bb-ede4-415a-9d48-f580b60eba04", NM_SETTING_VLAN_SETTING_NAME, &s_con); @@ -9297,7 +9298,7 @@ test_team_reread_slave(void) _writer_new_connection_reread((nmtst_get_rand_uint32() % 2) ? connection_1 : connection_2, TEST_SCRATCH_DIR, &testfile, - TEST_IFCFG_DIR "/ifcfg-team-slave-enp31s0f1-142.cexpected", + TEST_IFCFG_DIR "/ifcfg-team-port-enp31s0f1-142.cexpected", &reread, &reread_same); _assert_reread_same((nmtst_get_rand_uint32() % 2) ? connection_1 : connection_2, reread); @@ -10894,14 +10895,14 @@ main(int argc, char **argv) g_test_add_func(TPATH "bond/read-controller", test_read_bond_main); g_test_add_func(TPATH "bond/read-controller-eth-type", test_read_bond_eth_type); - g_test_add_func(TPATH "bond/read-slave", test_read_bond_slave); - g_test_add_func(TPATH "bond/read-slave-ib", test_read_bond_slave_ib); + g_test_add_func(TPATH "bond/read-port", test_read_bond_port); + g_test_add_func(TPATH "bond/read-port-ib", test_read_bond_port_ib); g_test_add_func(TPATH "bond/write-controller", test_write_bond_main); - g_test_add_func(TPATH "bond/write-slave", test_write_bond_slave); - g_test_add_func(TPATH "bond/write-slave-ib", test_write_bond_slave_ib); + g_test_add_func(TPATH "bond/write-port", test_write_bond_port); + g_test_add_func(TPATH "bond/write-port-ib", test_write_bond_port_ib); g_test_add_func(TPATH "bond/bonding-opts-numeric-mode", test_read_bond_opts_mode_numeric); - g_test_add_func(TPATH "bond/read-bond-port", test_read_bond_port); - g_test_add_func(TPATH "bond/write-bond-port", test_write_bond_port); + g_test_add_func(TPATH "bond/read-bond-port", test_read_bond_port_setting); + g_test_add_func(TPATH "bond/write-bond-port_setting", test_write_bond_port_setting); g_test_add_func(TPATH "bridge/read-controller", test_read_bridge_main); g_test_add_func(TPATH "bridge/write-controller", test_write_bridge_main); @@ -10928,7 +10929,7 @@ main(int argc, char **argv) g_test_add_func(TPATH "team/write-port", test_write_team_port); g_test_add_func(TPATH "team/write-infiniband-port", test_write_team_infiniband_port); g_test_add_func(TPATH "team/read-port-empty-config", test_read_team_port_empty_config); - g_test_add_func(TPATH "team/reread-slave", test_team_reread_slave); + g_test_add_func(TPATH "team/reread-port", test_team_reread_port); g_test_add_func(TPATH "proxy/read-proxy-basic", test_read_proxy_basic); g_test_add_func(TPATH "proxy/write-proxy-basic", test_write_proxy_basic); diff --git a/src/core/settings/plugins/keyfile/tests/keyfiles/Test_Bridge_Component b/src/core/settings/plugins/keyfile/tests/keyfiles/Test_Bridge_Component index 95da3d461..0837f9783 100644 --- a/src/core/settings/plugins/keyfile/tests/keyfiles/Test_Bridge_Component +++ b/src/core/settings/plugins/keyfile/tests/keyfiles/Test_Bridge_Component @@ -3,7 +3,7 @@ id=Test Bridge Component uuid=d7b4f96c-c45e-4298-bef8-f48574f8c1c0 type=802-3-ethernet controller=br0 -slave-type=bridge +port-type=bridge [802-3-ethernet] mac-address=00:22:15:59:62:97 diff --git a/src/core/settings/plugins/keyfile/tests/keyfiles/Test_minimal_slave_1 b/src/core/settings/plugins/keyfile/tests/keyfiles/Test_minimal_port_1 similarity index 72% rename from src/core/settings/plugins/keyfile/tests/keyfiles/Test_minimal_slave_1 rename to src/core/settings/plugins/keyfile/tests/keyfiles/Test_minimal_port_1 index 226edfe24..c801f1645 100644 --- a/src/core/settings/plugins/keyfile/tests/keyfiles/Test_minimal_slave_1 +++ b/src/core/settings/plugins/keyfile/tests/keyfiles/Test_minimal_port_1 @@ -1,4 +1,4 @@ [connection] type=802-3-ethernet controller=br0 -slave-type=bridge +port-type=bridge diff --git a/src/core/settings/plugins/keyfile/tests/keyfiles/Test_minimal_slave_2 b/src/core/settings/plugins/keyfile/tests/keyfiles/Test_minimal_port_2 similarity index 100% rename from src/core/settings/plugins/keyfile/tests/keyfiles/Test_minimal_slave_2 rename to src/core/settings/plugins/keyfile/tests/keyfiles/Test_minimal_port_2 diff --git a/src/core/settings/plugins/keyfile/tests/keyfiles/Test_minimal_slave_3 b/src/core/settings/plugins/keyfile/tests/keyfiles/Test_minimal_port_3 similarity index 71% rename from src/core/settings/plugins/keyfile/tests/keyfiles/Test_minimal_slave_3 rename to src/core/settings/plugins/keyfile/tests/keyfiles/Test_minimal_port_3 index 4027fec16..9e3f94025 100644 --- a/src/core/settings/plugins/keyfile/tests/keyfiles/Test_minimal_slave_3 +++ b/src/core/settings/plugins/keyfile/tests/keyfiles/Test_minimal_port_3 @@ -1,4 +1,4 @@ [connection] controller=br0 -slave-type=bridge +port-type=bridge [802-3-ethernet] diff --git a/src/core/settings/plugins/keyfile/tests/keyfiles/Test_minimal_slave_4 b/src/core/settings/plugins/keyfile/tests/keyfiles/Test_minimal_port_4 similarity index 100% rename from src/core/settings/plugins/keyfile/tests/keyfiles/Test_minimal_slave_4 rename to src/core/settings/plugins/keyfile/tests/keyfiles/Test_minimal_port_4 diff --git a/src/core/settings/plugins/keyfile/tests/test-keyfile-settings.c b/src/core/settings/plugins/keyfile/tests/test-keyfile-settings.c index e3e5f84ff..f999105ad 100644 --- a/src/core/settings/plugins/keyfile/tests/test-keyfile-settings.c +++ b/src/core/settings/plugins/keyfile/tests/test-keyfile-settings.c @@ -2346,13 +2346,13 @@ test_read_minimal(void) } static void -test_read_minimal_slave(void) +test_read_minimal_port(void) { gs_unref_object NMConnection *connection = NULL; gs_unref_object NMConnection *con_archetype = NULL; NMSettingConnection *s_con; - con_archetype = nmtst_create_minimal_connection("Test_minimal_slave_x", + con_archetype = nmtst_create_minimal_connection("Test_minimal_port_x", "a56b4ca5-7075-43d4-82c7-5d0cb15f7654", NM_SETTING_WIRED_SETTING_NAME, &s_con); @@ -2364,7 +2364,7 @@ test_read_minimal_slave(void) NULL); nmtst_connection_normalize(con_archetype); - connection = keyfile_read_connection_from_file(TEST_KEYFILES_DIR "/Test_minimal_slave_1"); + connection = keyfile_read_connection_from_file(TEST_KEYFILES_DIR "/Test_minimal_port_1"); g_object_set(s_con, NM_SETTING_CONNECTION_ID, nm_connection_get_id(connection), @@ -2374,7 +2374,7 @@ test_read_minimal_slave(void) nmtst_assert_connection_equals(con_archetype, FALSE, connection, FALSE); g_clear_object(&connection); - connection = keyfile_read_connection_from_file(TEST_KEYFILES_DIR "/Test_minimal_slave_2"); + connection = keyfile_read_connection_from_file(TEST_KEYFILES_DIR "/Test_minimal_port_2"); g_object_set(s_con, NM_SETTING_CONNECTION_ID, nm_connection_get_id(connection), @@ -2384,7 +2384,7 @@ test_read_minimal_slave(void) nmtst_assert_connection_equals(con_archetype, FALSE, connection, FALSE); g_clear_object(&connection); - connection = keyfile_read_connection_from_file(TEST_KEYFILES_DIR "/Test_minimal_slave_3"); + connection = keyfile_read_connection_from_file(TEST_KEYFILES_DIR "/Test_minimal_port_3"); g_object_set(s_con, NM_SETTING_CONNECTION_ID, nm_connection_get_id(connection), @@ -2394,7 +2394,7 @@ test_read_minimal_slave(void) nmtst_assert_connection_equals(con_archetype, FALSE, connection, FALSE); g_clear_object(&connection); - connection = keyfile_read_connection_from_file(TEST_KEYFILES_DIR "/Test_minimal_slave_4"); + connection = keyfile_read_connection_from_file(TEST_KEYFILES_DIR "/Test_minimal_port_4"); g_object_set(s_con, NM_SETTING_CONNECTION_ID, nm_connection_get_id(connection), @@ -2921,7 +2921,7 @@ main(int argc, char **argv) g_test_add_func("/keyfile/test_read_missing_id_uuid", test_read_missing_id_uuid); g_test_add_func("/keyfile/test_read_minimal", test_read_minimal); - g_test_add_func("/keyfile/test_read_minimal_slave", test_read_minimal_slave); + g_test_add_func("/keyfile/test_read_minimal_port", test_read_minimal_port); g_test_add_func("/keyfile/test_read_enum_property", test_read_enum_property); g_test_add_func("/keyfile/test_write_enum_property", test_write_enum_property); diff --git a/src/libnm-client-impl/nm-device-bond.c b/src/libnm-client-impl/nm-device-bond.c index affcb9934..9942c8dee 100644 --- a/src/libnm-client-impl/nm-device-bond.c +++ b/src/libnm-client-impl/nm-device-bond.c @@ -76,7 +76,7 @@ nm_device_bond_get_carrier(NMDeviceBond *device) * nm_device_bond_get_slaves: * @device: a #NMDeviceBond * - * Gets the devices currently enslaved to @device. + * Gets the devices currently attached as port to @device. * * Returns: (element-type NMDevice): the #GPtrArray containing * #NMDevices that are slaves of @device. This is the internal @@ -105,7 +105,7 @@ connection_compatible(NMDevice *device, NMConnection *connection, GError **error return FALSE; } - /* FIXME: check slaves? */ + /* FIXME: check ports? */ return TRUE; } @@ -183,7 +183,7 @@ nm_device_bond_class_init(NMDeviceBondClass *klass) /** * NMDeviceBond:slaves: (type GPtrArray(NMDevice)) * - * The devices enslaved to the bond device. + * The devices attached as port to the bond device. **/ obj_properties[PROP_SLAVES] = g_param_spec_boxed(NM_DEVICE_BOND_SLAVES, "", @@ -193,5 +193,5 @@ nm_device_bond_class_init(NMDeviceBondClass *klass) _nml_dbus_meta_class_init_with_properties(object_class, &_nml_dbus_meta_iface_nm_device_bond); - device_class->slaves_param_spec = obj_properties[PROP_SLAVES]; + device_class->ports_param_spec = obj_properties[PROP_SLAVES]; } diff --git a/src/libnm-client-impl/nm-device-bridge.c b/src/libnm-client-impl/nm-device-bridge.c index abb78ced3..8405a4ffd 100644 --- a/src/libnm-client-impl/nm-device-bridge.c +++ b/src/libnm-client-impl/nm-device-bridge.c @@ -76,10 +76,10 @@ nm_device_bridge_get_carrier(NMDeviceBridge *device) * nm_device_bridge_get_slaves: * @device: a #NMDeviceBridge * - * Gets the devices currently enslaved to @device. + * Gets the devices currently attached as port to @device. * * Returns: (element-type NMDevice): the #GPtrArray containing - * #NMDevices that are slaves of @device. This is the internal + * #NMDevices that are ports of @device. This is the internal * copy used by the device, and must not be modified. * * Deprecated: 1.34: Use nm_device_get_ports() instead. @@ -188,7 +188,7 @@ nm_device_bridge_class_init(NMDeviceBridgeClass *klass) /** * NMDeviceBridge:slaves: (type GPtrArray(NMDevice)) * - * The devices enslaved to the bridge device. + * The devices attached as port to the bridge device. **/ obj_properties[PROP_SLAVES] = g_param_spec_boxed(NM_DEVICE_BRIDGE_SLAVES, "", @@ -198,5 +198,5 @@ nm_device_bridge_class_init(NMDeviceBridgeClass *klass) _nml_dbus_meta_class_init_with_properties(object_class, &_nml_dbus_meta_iface_nm_device_bridge); - device_class->slaves_param_spec = obj_properties[PROP_SLAVES]; + device_class->ports_param_spec = obj_properties[PROP_SLAVES]; } diff --git a/src/libnm-client-impl/nm-device-ovs-bridge.c b/src/libnm-client-impl/nm-device-ovs-bridge.c index ef134798d..56b76e905 100644 --- a/src/libnm-client-impl/nm-device-ovs-bridge.c +++ b/src/libnm-client-impl/nm-device-ovs-bridge.c @@ -36,10 +36,10 @@ G_DEFINE_TYPE(NMDeviceOvsBridge, nm_device_ovs_bridge, NM_TYPE_DEVICE) * nm_device_ovs_bridge_get_slaves: * @device: a #NMDeviceOvsBridge * - * Gets the ports currently enslaved to @device. + * Gets the ports currently attached as port to @device. * * Returns: (element-type NMDevice): the #GPtrArray containing - * #NMDevices that are slaves of @device. This is the internal + * #NMDevices that are ports of @device. This is the internal * copy used by the device, and must not be modified. * * Since: 1.14 @@ -142,7 +142,7 @@ nm_device_ovs_bridge_class_init(NMDeviceOvsBridgeClass *klass) /** * NMDeviceOvsBridge:slaves: (type GPtrArray(NMDevice)) * - * Gets the ports currently enslaved to the device. + * Gets the ports currently attached as port to the device. * * Since: 1.22 */ @@ -155,5 +155,5 @@ nm_device_ovs_bridge_class_init(NMDeviceOvsBridgeClass *klass) _nml_dbus_meta_class_init_with_properties(object_class, &_nml_dbus_meta_iface_nm_device_ovsbridge); - device_class->slaves_param_spec = obj_properties[PROP_SLAVES]; + device_class->ports_param_spec = obj_properties[PROP_SLAVES]; } diff --git a/src/libnm-client-impl/nm-device-ovs-port.c b/src/libnm-client-impl/nm-device-ovs-port.c index 5bcef73c4..38e952310 100644 --- a/src/libnm-client-impl/nm-device-ovs-port.c +++ b/src/libnm-client-impl/nm-device-ovs-port.c @@ -36,10 +36,10 @@ G_DEFINE_TYPE(NMDeviceOvsPort, nm_device_ovs_port, NM_TYPE_DEVICE) * nm_device_ovs_port_get_slaves: * @device: a #NMDeviceOvsPort * - * Gets the interfaces currently enslaved to @device. + * Gets the interfaces currently attached as port to @device. * * Returns: (element-type NMDevice): the #GPtrArray containing - * #NMDevices that are slaves of @device. This is the internal + * #NMDevices that are ports of @device. This is the internal * copy used by the device, and must not be modified. * * Since: 1.14 @@ -142,7 +142,7 @@ nm_device_ovs_port_class_init(NMDeviceOvsPortClass *klass) /** * NMDeviceOvsPort:slaves: (type GPtrArray(NMDevice)) * - * Gets the interfaces currently enslaved to the device. + * Gets the interfaces currently attached as port to the device. * * Since: 1.22 */ @@ -155,5 +155,5 @@ nm_device_ovs_port_class_init(NMDeviceOvsPortClass *klass) _nml_dbus_meta_class_init_with_properties(object_class, &_nml_dbus_meta_iface_nm_device_ovsport); - device_class->slaves_param_spec = obj_properties[PROP_SLAVES]; + device_class->ports_param_spec = obj_properties[PROP_SLAVES]; } diff --git a/src/libnm-client-impl/nm-device-team.c b/src/libnm-client-impl/nm-device-team.c index e0b21e8e9..bf951ca14 100644 --- a/src/libnm-client-impl/nm-device-team.c +++ b/src/libnm-client-impl/nm-device-team.c @@ -77,10 +77,10 @@ nm_device_team_get_carrier(NMDeviceTeam *device) * nm_device_team_get_slaves: * @device: a #NMDeviceTeam * - * Gets the devices currently enslaved to @device. + * Gets the devices currently attach as port to @device. * * Returns: (element-type NMDevice): the #GPtrArray containing - * #NMDevices that are slaves of @device. This is the internal + * #NMDevices that are ports of @device. This is the internal * copy used by the device, and must not be modified. * * Deprecated: 1.34: Use nm_device_get_ports() instead. @@ -125,7 +125,7 @@ connection_compatible(NMDevice *device, NMConnection *connection, GError **error return FALSE; } - /* FIXME: check slaves? */ + /* FIXME: check ports? */ return TRUE; } @@ -218,7 +218,7 @@ nm_device_team_class_init(NMDeviceTeamClass *klass) /** * NMDeviceTeam:slaves: (type GPtrArray(NMDevice)) * - * The devices enslaved to the team device. + * The devices attached as port to the team device. **/ obj_properties[PROP_SLAVES] = g_param_spec_boxed(NM_DEVICE_TEAM_SLAVES, "", @@ -241,5 +241,5 @@ nm_device_team_class_init(NMDeviceTeamClass *klass) _nml_dbus_meta_class_init_with_properties(object_class, &_nml_dbus_meta_iface_nm_device_team); - device_class->slaves_param_spec = obj_properties[PROP_SLAVES]; + device_class->ports_param_spec = obj_properties[PROP_SLAVES]; } diff --git a/src/libnm-client-impl/nm-device.c b/src/libnm-client-impl/nm-device.c index 2d3be64c8..dc868f5b9 100644 --- a/src/libnm-client-impl/nm-device.c +++ b/src/libnm-client-impl/nm-device.c @@ -1283,7 +1283,7 @@ nm_device_get_type_description(NMDevice *device) * Gets the devices currently set as port of @device. * * Returns: (element-type NMDevice): the #GPtrArray containing #NMDevices that - * are slaves of @device. This is the internal copy used by the device and + * are ports of @device. This is the internal copy used by the device and * must not be modified. * * Since: 1.34 @@ -1397,8 +1397,8 @@ _nm_device_notify_update_prop_ports(NMClient *client, nm_assert(notify_update_prop_flags == NML_DBUS_NOTIFY_UPDATE_PROP_FLAGS_NOTIFY); klass = NM_DEVICE_GET_CLASS(self); - if (klass->slaves_param_spec) - _nm_client_queue_notify_object(client, self, klass->slaves_param_spec); + if (klass->ports_param_spec) + _nm_client_queue_notify_object(client, self, klass->ports_param_spec); out: return NML_DBUS_NOTIFY_UPDATE_PROP_FLAGS_NONE; } diff --git a/src/libnm-client-impl/nm-libnm-utils.h b/src/libnm-client-impl/nm-libnm-utils.h index 53fa36be1..fddda077c 100644 --- a/src/libnm-client-impl/nm-libnm-utils.h +++ b/src/libnm-client-impl/nm-libnm-utils.h @@ -852,7 +852,7 @@ struct _NMDeviceClass { /* Slaves was originally part of some subtypes of NMDevice. It was deprecated and * a new NMDevice::ports property was added. When that property changes, we need * to notify about the subclass' respective property. This is the property. */ - const GParamSpec *slaves_param_spec; + const GParamSpec *ports_param_spec; }; #define _NML_DEVICE_META_PROPERTY_INDEX_PORTS 27 diff --git a/src/libnm-core-impl/nm-connection-private.h b/src/libnm-core-impl/nm-connection-private.h index 3b2c36fdf..9f9007b68 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); +const char *_nm_connection_detect_port_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); +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 d61fa85a2..6dace2b73 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,7 +1890,7 @@ _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 controller without IP config was not a verify() error, accept @@ -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,7 +1915,7 @@ _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 controller without IP config was not a verify() error, accept @@ -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,7 +1940,7 @@ _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 controller without proxy config was not a verify() error, accept @@ -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 81f7170ea..8dadf3cdf 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. */ diff --git a/src/libnm-core-impl/nm-setting-6lowpan.c b/src/libnm-core-impl/nm-setting-6lowpan.c index 9748e5842..1da30062c 100644 --- a/src/libnm-core-impl/nm-setting-6lowpan.c +++ b/src/libnm-core-impl/nm-setting-6lowpan.c @@ -87,14 +87,14 @@ verify(NMSetting *setting, NMConnection *connection, GError **error) } if (nm_utils_is_uuid(priv->parent)) { - /* If we have an NMSettingConnection:controller 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 *controller = 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)) + 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 (controller && g_strcmp0(priv->parent, controller) != 0) { diff --git a/src/libnm-core-impl/nm-setting-bond-port.c b/src/libnm-core-impl/nm-setting-bond-port.c index 342d6dd06..4f1270a81 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 dcb17896d..e5f0e1754 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 df8f7c22a..b51cd46bd 100644 --- a/src/libnm-core-impl/nm-setting-connection.c +++ b/src/libnm-core-impl/nm-setting-connection.c @@ -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; + 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_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) { + 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 @@ -2589,9 +2588,9 @@ nm_setting_connection_class_init(NMSettingConnectionClass *klass) /** * NMSettingConnection:slave-type: * - * Setting name of the device type of this slave's controller 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 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 fa69f5eb0..74d99c2e5 100644 --- a/src/libnm-core-impl/nm-setting-macsec.c +++ b/src/libnm-core-impl/nm-setting-macsec.c @@ -316,14 +316,14 @@ verify(NMSetting *setting, NMConnection *connection, GError **error) if (priv->parent) { if (nm_utils_is_uuid(priv->parent)) { - /* If we have an NMSettingConnection:controller 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 *controller = 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)) + 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 (controller && g_strcmp0(priv->parent, controller) != 0) { 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 0cdf3e6bf..9acdae6c5 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 47c736659..22b3bf9e3 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 38076af68..7e5e5e14e 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) { @@ -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 7d4932484..da7fdbb70 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 a881ec5f0..5c04e1575 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 3ca15275b..59fbdcb23 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 @@ -1781,9 +1781,10 @@ nm_setting_team_class_init(NMSettingTeamClass *klass) "", NULL, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); - _nm_properties_override_gobj(properties_override, - obj_properties[NM_TEAM_ATTRIBUTE_CONTROLLER_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 38273cda9..3a1f09301 100644 --- a/src/libnm-core-impl/nm-setting-vlan.c +++ b/src/libnm-core-impl/nm-setting-vlan.c @@ -608,14 +608,14 @@ verify(NMSetting *setting, NMConnection *connection, GError **error) if (priv->parent) { if (nm_utils_is_uuid(priv->parent)) { - /* If we have an NMSettingConnection:controller 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 *controller = 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)) + 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 (controller && g_strcmp0(priv->parent, controller) != 0) { diff --git a/src/libnm-core-impl/nm-setting.c b/src/libnm-core-impl/nm-setting.c index a97edc2aa..ed34db76f 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 cfc4acae8..6e7f85c7e 100644 --- a/src/libnm-core-impl/nm-team-utils.c +++ b/src/libnm-core-impl/nm-team-utils.c @@ -153,11 +153,11 @@ typedef struct { bool has_range : 1; } TeamAttrData; -#define TEAM_ATTR_IDX(_is_port, _team_attr) \ - (((!(_is_port) || (_team_attr) < _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)))) \ + + ((int) (_team_attr)))) \ - 1) #define TEAM_ATTR_IDX_CONFIG (TEAM_ATTR_IDX(FALSE, NM_TEAM_ATTRIBUTE_CONFIG)) @@ -2071,7 +2071,8 @@ _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_CONTROLLER_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_controller_runner_tx_hash_free @@ -2260,7 +2261,8 @@ _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_CONTROLLER_RUNNER_TX_HASH) { + 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]; diff --git a/src/libnm-core-impl/nm-utils.c b/src/libnm-core-impl/nm-utils.c index 187fd3d90..f7f4e770a 100644 --- a/src/libnm-core-impl/nm-utils.c +++ b/src/libnm-core-impl/nm-utils.c @@ -4904,7 +4904,7 @@ _nm_utils_dhcp_duid_valid(const char *duid, GBytes **out_duid_bin) * @other_type is a valid type for the parent of a VLAN. * * If @virtual_type is a "controller" type (eg, %NM_TYPE_SETTING_BRIDGE), - * then this checks if @other_type is a valid type for a slave of that + * 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 diff --git a/src/libnm-core-impl/tests/test-general.c b/src/libnm-core-impl/tests/test-general.c index cc6c5f965..0a39010c1 100644 --- a/src/libnm-core-impl/tests/test-general.c +++ b/src/libnm-core-impl/tests/test-general.c @@ -6231,12 +6231,12 @@ 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); @@ -6265,12 +6265,12 @@ 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); @@ -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 a6c522dfe..1912782e2 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); @@ -858,7 +858,7 @@ test_bridge_port_vlans(void) "type=dummy\n" "interface-name=dummy1\n" "controller=br0\n" - "slave-type=bridge\n" + "port-type=bridge\n" "\n" "[bridge-port]\n" "vlans=4094 pvid , 10-20 untagged\n" diff --git a/src/libnm-glib-aux/nm-errno.c b/src/libnm-glib-aux/nm-errno.c index 682bfea2a..9feac2adb 100644 --- a/src/libnm-glib-aux/nm-errno.c +++ b/src/libnm-glib-aux/nm-errno.c @@ -39,7 +39,7 @@ static NM_UTILS_LOOKUP_STR_DEFINE( NM_UTILS_LOOKUP_STR_ITEM(NME_PL_NOT_FOUND, "not-found"), NM_UTILS_LOOKUP_STR_ITEM(NME_PL_EXISTS, "exists"), NM_UTILS_LOOKUP_STR_ITEM(NME_PL_WRONG_TYPE, "wrong-type"), - NM_UTILS_LOOKUP_STR_ITEM(NME_PL_NOT_SLAVE, "not-slave"), + NM_UTILS_LOOKUP_STR_ITEM(NME_PL_NOT_SLAVE, "not-port"), NM_UTILS_LOOKUP_STR_ITEM(NME_PL_NO_FIRMWARE, "no-firmware"), NM_UTILS_LOOKUP_STR_ITEM(NME_PL_OPNOTSUPP, "not-supported"), NM_UTILS_LOOKUP_STR_ITEM(NME_PL_NETLINK, "netlink"), diff --git a/src/libnm-glib-aux/nm-shared-utils.h b/src/libnm-glib-aux/nm-shared-utils.h index 8a1ce00cd..ca9feb608 100644 --- a/src/libnm-glib-aux/nm-shared-utils.h +++ b/src/libnm-glib-aux/nm-shared-utils.h @@ -154,7 +154,7 @@ typedef enum { NM_LINK_TYPE_WIREGUARD, #define _NM_LINK_TYPE_SW_LAST NM_LINK_TYPE_WIREGUARD -/* Software types with slaves */ +/* Software types with ports */ #define _NM_LINK_TYPE_SW_CONTROLLER_FIRST NM_LINK_TYPE_BRIDGE NM_LINK_TYPE_BRIDGE, NM_LINK_TYPE_BOND, @@ -177,7 +177,7 @@ nm_link_type_is_software(NMLinkType link_type) } static inline gboolean -nm_link_type_supports_slaves(NMLinkType link_type) +nm_link_type_supports_ports(NMLinkType link_type) { return link_type >= _NM_LINK_TYPE_SW_CONTROLLER_FIRST && link_type <= _NM_LINK_TYPE_SW_CONTROLLER_LAST; diff --git a/src/libnm-platform/nm-linux-platform.c b/src/libnm-platform/nm-linux-platform.c index 371bbe9d1..c8a4c5637 100644 --- a/src/libnm-platform/nm-linux-platform.c +++ b/src/libnm-platform/nm-linux-platform.c @@ -108,6 +108,9 @@ typedef enum _nm_packed { /*****************************************************************************/ +#define IFLA_INFO_PORT_KIND IFLA_INFO_SLAVE_KIND +#define IFLA_INFO_PORT_DATA IFLA_INFO_SLAVE_DATA + #ifndef IFLA_PROMISCUITY #define IFLA_PROMISCUITY 30 #endif @@ -184,7 +187,10 @@ G_STATIC_ASSERT(RTA_MAX == (__RTA_MAX - 1)); /*****************************************************************************/ -#define IFLA_BOND_SLAVE_PRIO 9 +#define IFLA_BOND_ACTIVE_PORT IFLA_BOND_ACTIVE_SLAVE +#define IFLA_BOND_PORT_PRIO IFLA_BOND_SLAVE_PRIO +#define IFLA_BOND_ALL_PORTS_ACTIVE IFLA_BOND_ALL_SLAVES_ACTIVE +#define IFLA_BOND_PACKETS_PER_PORT IFLA_BOND_PACKETS_PER_SLAVE #define IFLA_BOND_PEER_NOTIF_DELAY 28 #define IFLA_BOND_AD_LACP_ACTIVE 29 @@ -1627,7 +1633,7 @@ _parse_lnk_bond(const char *kind, struct nlattr *info_data) { static const struct nla_policy policy[] = { [IFLA_BOND_MODE] = {.type = NLA_U8}, - [IFLA_BOND_ACTIVE_SLAVE] = {.type = NLA_U32}, + [IFLA_BOND_ACTIVE_PORT] = {.type = NLA_U32}, [IFLA_BOND_MIIMON] = {.type = NLA_U32}, [IFLA_BOND_UPDELAY] = {.type = NLA_U32}, [IFLA_BOND_DOWNDELAY] = {.type = NLA_U32}, @@ -1642,10 +1648,10 @@ _parse_lnk_bond(const char *kind, struct nlattr *info_data) [IFLA_BOND_XMIT_HASH_POLICY] = {.type = NLA_U8}, [IFLA_BOND_RESEND_IGMP] = {.type = NLA_U32}, [IFLA_BOND_NUM_PEER_NOTIF] = {.type = NLA_U8}, - [IFLA_BOND_ALL_SLAVES_ACTIVE] = {.type = NLA_U8}, + [IFLA_BOND_ALL_PORTS_ACTIVE] = {.type = NLA_U8}, [IFLA_BOND_MIN_LINKS] = {.type = NLA_U32}, [IFLA_BOND_LP_INTERVAL] = {.type = NLA_U32}, - [IFLA_BOND_PACKETS_PER_SLAVE] = {.type = NLA_U32}, + [IFLA_BOND_PACKETS_PER_PORT] = {.type = NLA_U32}, [IFLA_BOND_AD_LACP_RATE] = {.type = NLA_U8}, [IFLA_BOND_AD_SELECT] = {.type = NLA_U8}, [IFLA_BOND_AD_ACTOR_SYS_PRIO] = {.type = NLA_U16}, @@ -1741,16 +1747,16 @@ _parse_lnk_bond(const char *kind, struct nlattr *info_data) } if (tb[IFLA_BOND_NUM_PEER_NOTIF]) props->num_grat_arp = nla_get_u8(tb[IFLA_BOND_NUM_PEER_NOTIF]); - if (tb[IFLA_BOND_ALL_SLAVES_ACTIVE]) - props->all_ports_active = nla_get_u8(tb[IFLA_BOND_ALL_SLAVES_ACTIVE]); + if (tb[IFLA_BOND_ALL_PORTS_ACTIVE]) + props->all_ports_active = nla_get_u8(tb[IFLA_BOND_ALL_PORTS_ACTIVE]); if (tb[IFLA_BOND_MISSED_MAX]) props->arp_missed_max = nla_get_u8(tb[IFLA_BOND_MISSED_MAX]); if (tb[IFLA_BOND_MIN_LINKS]) props->min_links = nla_get_u32(tb[IFLA_BOND_MIN_LINKS]); if (tb[IFLA_BOND_LP_INTERVAL]) props->lp_interval = nla_get_u32(tb[IFLA_BOND_LP_INTERVAL]); - if (tb[IFLA_BOND_PACKETS_PER_SLAVE]) - props->packets_per_port = nla_get_u32(tb[IFLA_BOND_PACKETS_PER_SLAVE]); + if (tb[IFLA_BOND_PACKETS_PER_PORT]) + props->packets_per_port = nla_get_u32(tb[IFLA_BOND_PACKETS_PER_PORT]); if (tb[IFLA_BOND_AD_LACP_RATE]) props->lacp_rate = nla_get_u8(tb[IFLA_BOND_AD_LACP_RATE]); if (tb[IFLA_BOND_AD_LACP_ACTIVE]) { @@ -3463,11 +3469,11 @@ _new_from_nl_link(NMPlatform *platform, if (tb[IFLA_LINKINFO]) { static const struct nla_policy policy_link_info[] = { - [IFLA_INFO_KIND] = {.type = NLA_STRING}, - [IFLA_INFO_DATA] = {.type = NLA_NESTED}, - [IFLA_INFO_XSTATS] = {.type = NLA_NESTED}, - [IFLA_INFO_SLAVE_KIND] = {.type = NLA_STRING}, - [IFLA_INFO_SLAVE_DATA] = {.type = NLA_NESTED}, + [IFLA_INFO_KIND] = {.type = NLA_STRING}, + [IFLA_INFO_DATA] = {.type = NLA_NESTED}, + [IFLA_INFO_XSTATS] = {.type = NLA_NESTED}, + [IFLA_INFO_PORT_KIND] = {.type = NLA_STRING}, + [IFLA_INFO_PORT_DATA] = {.type = NLA_NESTED}, }; struct nlattr *li[G_N_ELEMENTS(policy_link_info)]; @@ -3479,8 +3485,8 @@ _new_from_nl_link(NMPlatform *platform, nl_info_data = li[IFLA_INFO_DATA]; - if (li[IFLA_INFO_SLAVE_KIND]) { - const char *s = nla_get_string(li[IFLA_INFO_SLAVE_KIND]); + if (li[IFLA_INFO_PORT_KIND]) { + const char *s = nla_get_string(li[IFLA_INFO_PORT_KIND]); if (nm_streq(s, "bond")) obj->link.port_kind = NM_PORT_KIND_BOND; @@ -3488,10 +3494,10 @@ _new_from_nl_link(NMPlatform *platform, obj->link.port_kind = NM_PORT_KIND_BRIDGE; } - if (li[IFLA_INFO_SLAVE_DATA]) { + if (li[IFLA_INFO_PORT_DATA]) { static const struct nla_policy policy_bond_port[] = { [IFLA_BOND_SLAVE_QUEUE_ID] = {.type = NLA_U16}, - [IFLA_BOND_SLAVE_PRIO] = {.type = NLA_S32}, + [IFLA_BOND_PORT_PRIO] = {.type = NLA_S32}, }; struct nlattr *bp[G_N_ELEMENTS(policy_bond_port)]; static const struct nla_policy policy_bridge_port[] = { @@ -3503,30 +3509,30 @@ _new_from_nl_link(NMPlatform *platform, switch (obj->link.port_kind) { case NM_PORT_KIND_BOND: - if (nla_parse_nested_arr(bp, li[IFLA_INFO_SLAVE_DATA], policy_bond_port) < 0) + if (nla_parse_nested_arr(bp, li[IFLA_INFO_PORT_DATA], policy_bond_port) < 0) return NULL; if (bp[IFLA_BOND_SLAVE_QUEUE_ID]) obj->link.port_data.bond.queue_id = nla_get_u16(bp[IFLA_BOND_SLAVE_QUEUE_ID]); - if (bp[IFLA_BOND_SLAVE_PRIO]) { - obj->link.port_data.bond.prio = nla_get_s32(bp[IFLA_BOND_SLAVE_PRIO]); + if (bp[IFLA_BOND_PORT_PRIO]) { + obj->link.port_data.bond.prio = nla_get_s32(bp[IFLA_BOND_PORT_PRIO]); obj->link.port_data.bond.prio_has = TRUE; if (!_nm_platform_kernel_support_detected( - NM_PLATFORM_KERNEL_SUPPORT_TYPE_IFLA_BOND_SLAVE_PRIO)) { - /* support for IFLA_BOND_SLAVE_PRIO was added in 0a2ff7cc8ad48a86939a91bd3457f38e59e741a1, + NM_PLATFORM_KERNEL_SUPPORT_TYPE_IFLA_BOND_PORT_PRIO)) { + /* support for IFLA_BOND_PORT_PRIO was added in 0a2ff7cc8ad48a86939a91bd3457f38e59e741a1, * kernel 6.0, 2 October 2022. * * We can only detect support if the attribute is present. A missing attribute * is not conclusive. */ _nm_platform_kernel_support_init( - NM_PLATFORM_KERNEL_SUPPORT_TYPE_IFLA_BOND_SLAVE_PRIO, + NM_PLATFORM_KERNEL_SUPPORT_TYPE_IFLA_BOND_PORT_PRIO, 1); } } break; case NM_PORT_KIND_BRIDGE: - if (nla_parse_nested_arr(brp, li[IFLA_INFO_SLAVE_DATA], policy_bridge_port) < 0) + if (nla_parse_nested_arr(brp, li[IFLA_INFO_PORT_DATA], policy_bridge_port) < 0) return NULL; if (brp[IFLA_BRPORT_COST]) @@ -4952,7 +4958,7 @@ _nl_msg_new_link_set_linkinfo(struct nl_msg *msg, NMLinkType link_type, gconstpo if (props->min_links) NLA_PUT_U32(msg, IFLA_BOND_MIN_LINKS, props->min_links); if (props->packets_per_port) - NLA_PUT_U32(msg, IFLA_BOND_PACKETS_PER_SLAVE, props->packets_per_port); + NLA_PUT_U32(msg, IFLA_BOND_PACKETS_PER_PORT, props->packets_per_port); if (props->peer_notif_delay_has) NLA_PUT_U32(msg, IFLA_BOND_PEER_NOTIF_DELAY, props->peer_notif_delay); if (props->primary > 0) @@ -4975,7 +4981,7 @@ _nl_msg_new_link_set_linkinfo(struct nl_msg *msg, NMLinkType link_type, gconstpo if (props->arp_missed_max) NLA_PUT_U8(msg, IFLA_BOND_MISSED_MAX, props->arp_missed_max); - NLA_PUT_U8(msg, IFLA_BOND_ALL_SLAVES_ACTIVE, props->all_ports_active); + NLA_PUT_U8(msg, IFLA_BOND_ALL_PORTS_ACTIVE, props->all_ports_active); if (props->fail_over_mac) NLA_PUT_U8(msg, IFLA_BOND_FAIL_OVER_MAC, props->fail_over_mac); @@ -7369,7 +7375,7 @@ cache_on_change(NMPlatform *platform, switch (klass->obj_type) { case NMP_OBJECT_TYPE_LINK: { - /* check whether changing a slave link can cause a controller link (bridge or bond) to go up/down */ + /* check whether changing a port link can cause a controller link (bridge or bond) to go up/down */ if (obj_old && nmp_cache_link_connected_needs_toggle_by_ifindex(cache, obj_old->link.controller, @@ -7531,7 +7537,7 @@ cache_on_change(NMPlatform *platform, } } { - /* on enslave/release, we also refresh the controller. */ + /* on attach/release, we also refresh the controller. */ int ifindex1 = 0, ifindex2 = 0; gboolean changed_controller, changed_connected; @@ -8750,15 +8756,15 @@ link_change(NMPlatform *platform, goto nla_put_failure; nm_assert(nm_streq0("bond", nm_link_type_to_rtnl_type_string(NM_LINK_TYPE_BOND))); - NLA_PUT_STRING(nlmsg, IFLA_INFO_SLAVE_KIND, "bond"); + NLA_PUT_STRING(nlmsg, IFLA_INFO_PORT_KIND, "bond"); - if (!(nl_port_data = nla_nest_start(nlmsg, IFLA_INFO_SLAVE_DATA))) + if (!(nl_port_data = nla_nest_start(nlmsg, IFLA_INFO_PORT_DATA))) goto nla_put_failure; NLA_PUT_U16(nlmsg, IFLA_BOND_SLAVE_QUEUE_ID, port_data->bond.queue_id); if (port_data->bond.prio_has) - NLA_PUT_S32(nlmsg, IFLA_BOND_SLAVE_PRIO, port_data->bond.prio); + NLA_PUT_S32(nlmsg, IFLA_BOND_PORT_PRIO, port_data->bond.prio); nla_nest_end(nlmsg, nl_port_data); nla_nest_end(nlmsg, nl_info); @@ -8771,9 +8777,9 @@ link_change(NMPlatform *platform, goto nla_put_failure; nm_assert(nm_streq0("bridge", nm_link_type_to_rtnl_type_string(NM_LINK_TYPE_BRIDGE))); - NLA_PUT_STRING(nlmsg, IFLA_INFO_SLAVE_KIND, "bridge"); + NLA_PUT_STRING(nlmsg, IFLA_INFO_PORT_KIND, "bridge"); - if (!(nl_port_data = nla_nest_start(nlmsg, IFLA_INFO_SLAVE_DATA))) + if (!(nl_port_data = nla_nest_start(nlmsg, IFLA_INFO_PORT_DATA))) goto nla_put_failure; NLA_PUT_U32(nlmsg, IFLA_BRPORT_COST, port_data->bridge.path_cost); @@ -9827,10 +9833,10 @@ link_vlan_change(NMPlatform *platform, } static gboolean -link_enslave(NMPlatform *platform, int controller, int slave) +link_attach_port(NMPlatform *platform, int controller, int port) { nm_auto_nlmsg struct nl_msg *nlmsg = NULL; - int ifindex = slave; + int ifindex = port; nlmsg = _nl_msg_new_link(RTM_NEWLINK, 0, ifindex, NULL); if (!nlmsg) @@ -9844,9 +9850,9 @@ nla_put_failure: } static gboolean -link_release(NMPlatform *platform, int controller, int slave) +link_release_port(NMPlatform *platform, int controller, int port) { - return link_enslave(platform, 0, slave); + return link_attach_port(platform, 0, port); } /*****************************************************************************/ @@ -11914,8 +11920,8 @@ nm_linux_platform_class_init(NMLinuxPlatformClass *klass) platform_class->link_supports_vlans = link_supports_vlans; platform_class->link_supports_sriov = link_supports_sriov; - platform_class->link_enslave = link_enslave; - platform_class->link_release = link_release; + platform_class->link_attach_port = link_attach_port; + platform_class->link_release_port = link_release_port; platform_class->link_can_assume = link_can_assume; diff --git a/src/libnm-platform/nm-platform.c b/src/libnm-platform/nm-platform.c index ca4a9cd68..f82de7f9d 100644 --- a/src/libnm-platform/nm-platform.c +++ b/src/libnm-platform/nm-platform.c @@ -1056,7 +1056,7 @@ nm_platform_link_get_all(NMPlatform *self) return NULL; /* first sort the links by their name. Below we will sort - * further by moving children/slaves to the end. */ + * further by moving children/ports to the end. */ g_ptr_array_sort(links, _link_get_all_presort); unseen = g_hash_table_new(nm_direct_hash, NULL); @@ -1089,7 +1089,7 @@ nm_platform_link_get_all(NMPlatform *self) } #endif - /* Re-order the links list such that children/slaves come after all ancestors */ + /* Re-order the links list such that children/ports come after all ancestors */ nm_assert(g_hash_table_size(unseen) == links->len); nresult = links->len; result = g_ptr_array_new_full(nresult, (GDestroyNotify) nmp_object_unref); @@ -1713,7 +1713,7 @@ nm_platform_link_is_software(NMPlatform *self, int ifindex) } /** - * nm_platform_link_supports_slaves: + * nm_platform_link_supports_ports: * @self: platform instance * @ifindex: Interface index. * @@ -1721,9 +1721,9 @@ nm_platform_link_is_software(NMPlatform *self, int ifindex) * other interfaces. */ gboolean -nm_platform_link_supports_slaves(NMPlatform *self, int ifindex) +nm_platform_link_supports_ports(NMPlatform *self, int ifindex) { - return nm_link_type_supports_slaves(nm_platform_link_get_type(self, ifindex)); + return nm_link_type_supports_ports(nm_platform_link_get_type(self, ifindex)); } /** @@ -2377,15 +2377,15 @@ nm_platform_link_get_driver_info(NMPlatform *self, } /** - * nm_platform_link_enslave: + * nm_platform_link_attach_port: * @self: platform instance * @controller: Interface index of the controller - * @ifindex: Interface index of the slave + * @ifindex: Interface index of the port * - * Enslave @ifindex to @controller. + * Enport @ifindex to @controller. */ gboolean -nm_platform_link_enslave(NMPlatform *self, int controller, int ifindex) +nm_platform_link_attach_port(NMPlatform *self, int controller, int ifindex) { _CHECK_SELF(self, klass, FALSE); @@ -2393,19 +2393,19 @@ nm_platform_link_enslave(NMPlatform *self, int controller, int ifindex) g_return_val_if_fail(ifindex > 0, FALSE); _LOG3D("link: enslaving to controller '%s'", nm_platform_link_get_name(self, controller)); - return klass->link_enslave(self, controller, ifindex); + return klass->link_attach_port(self, controller, ifindex); } /** - * nm_platform_link_release: + * nm_platform_link_release_port: * @self: platform instance * @controller: Interface index of the controller - * @ifindex: Interface index of the slave + * @ifindex: Interface index of the port * - * Release @slave from @controller. + * Release @port from @controller. */ gboolean -nm_platform_link_release(NMPlatform *self, int controller, int ifindex) +nm_platform_link_release_port(NMPlatform *self, int controller, int ifindex) { _CHECK_SELF(self, klass, FALSE); @@ -2419,22 +2419,22 @@ nm_platform_link_release(NMPlatform *self, int controller, int ifindex) ifindex, nm_platform_link_get_name(self, controller), controller); - return klass->link_release(self, controller, ifindex); + return klass->link_release_port(self, controller, ifindex); } /** * nm_platform_link_get_controller: * @self: platform instance - * @slave: Interface index of the slave. + * @port: Interface index of the port. * - * Returns: Interface index of the slave's controller. + * Returns: Interface index of the port's controller. */ int -nm_platform_link_get_controller(NMPlatform *self, int slave) +nm_platform_link_get_controller(NMPlatform *self, int port) { const NMPlatformLink *pllink; - pllink = nm_platform_link_get(self, slave); + pllink = nm_platform_link_get(self, port); return pllink ? pllink->controller : 0; } @@ -2866,9 +2866,9 @@ controller_category(NMPlatform *self, int controller) } static const char * -slave_category(NMPlatform *self, int slave) +port_category(NMPlatform *self, int port) { - int controller = nm_platform_link_get_controller(self, slave); + int controller = nm_platform_link_get_controller(self, port); if (controller <= 0) return NULL; @@ -2877,7 +2877,7 @@ slave_category(NMPlatform *self, int slave) case NM_LINK_TYPE_BRIDGE: return "brport"; case NM_LINK_TYPE_BOND: - return "bonding_slave"; + return "bonding_port"; default: return NULL; } @@ -2910,10 +2910,10 @@ nm_platform_sysctl_controller_get_option(NMPlatform *self, int ifindex, const ch } gboolean -nm_platform_sysctl_slave_set_option(NMPlatform *self, - int ifindex, - const char *option, - const char *value) +nm_platform_sysctl_port_set_option(NMPlatform *self, + int ifindex, + const char *option, + const char *value) { _CHECK_SELF(self, klass, FALSE); @@ -2921,18 +2921,18 @@ nm_platform_sysctl_slave_set_option(NMPlatform *self, g_return_val_if_fail(option, FALSE); g_return_val_if_fail(value, FALSE); - return link_set_option(self, ifindex, slave_category(self, ifindex), option, value); + return link_set_option(self, ifindex, port_category(self, ifindex), option, value); } char * -nm_platform_sysctl_slave_get_option(NMPlatform *self, int ifindex, const char *option) +nm_platform_sysctl_port_get_option(NMPlatform *self, int ifindex, const char *option) { _CHECK_SELF(self, klass, NULL); g_return_val_if_fail(ifindex > 0, FALSE); g_return_val_if_fail(option, FALSE); - return link_get_option(self, ifindex, slave_category(self, ifindex), option); + return link_get_option(self, ifindex, port_category(self, ifindex), option); } /*****************************************************************************/ diff --git a/src/libnm-platform/nm-platform.h b/src/libnm-platform/nm-platform.h index b87c218e5..b05b1297a 100644 --- a/src/libnm-platform/nm-platform.h +++ b/src/libnm-platform/nm-platform.h @@ -241,11 +241,11 @@ struct _NMPlatformLink { /* an interface can only hold IFLA_INFO_SLAVE_DATA for one link type */ NMPlatformLinkPortData port_data; - /* IFLA_INFO_SLAVE_KIND */ + /* IFLA_INFO_PORT_KIND */ NMPortKind port_kind; /* @connected is mostly identical to (@n_ifi_flags & IFF_UP). Except for bridge/bond controllers, - * where we coerce the link as disconnect if it has no slaves. */ + * where we coerce the link as disconnect if it has no ports. */ bool connected : 1; bool initialized : 1; @@ -1052,7 +1052,7 @@ typedef enum { * were added at the same time. */ NM_PLATFORM_KERNEL_SUPPORT_TYPE_FRA_IP_PROTO, - NM_PLATFORM_KERNEL_SUPPORT_TYPE_IFLA_BOND_SLAVE_PRIO, + NM_PLATFORM_KERNEL_SUPPORT_TYPE_IFLA_BOND_PORT_PRIO, _NM_PLATFORM_KERNEL_SUPPORT_NUM, } NMPlatformKernelSupportType; @@ -1206,8 +1206,8 @@ typedef struct { gboolean (*link_supports_vlans)(NMPlatform *self, int ifindex); gboolean (*link_supports_sriov)(NMPlatform *self, int ifindex); - gboolean (*link_enslave)(NMPlatform *self, int controller, int slave); - gboolean (*link_release)(NMPlatform *self, int controller, int slave); + gboolean (*link_attach_port)(NMPlatform *self, int controller, int port); + gboolean (*link_release_port)(NMPlatform *self, int controller, int port); gboolean (*link_can_assume)(NMPlatform *self, int ifindex); @@ -1973,12 +1973,12 @@ int nm_platform_link_get_inet6_addr_gen_mode(NMPlatform *self, int ifind gconstpointer nm_platform_link_get_address(NMPlatform *self, int ifindex, size_t *length); -int nm_platform_link_get_controller(NMPlatform *self, int slave); +int nm_platform_link_get_controller(NMPlatform *self, int port); gboolean nm_platform_link_can_assume(NMPlatform *self, int ifindex); NMOptionBool nm_platform_link_get_unmanaged(NMPlatform *self, int ifindex); -gboolean nm_platform_link_supports_slaves(NMPlatform *self, int ifindex); +gboolean nm_platform_link_supports_ports(NMPlatform *self, int ifindex); const char *nm_platform_link_get_type_name(NMPlatform *self, int ifindex); gboolean nm_platform_link_refresh(NMPlatform *self, int ifindex); @@ -2070,19 +2070,19 @@ gboolean nm_platform_link_supports_carrier_detect(NMPlatform *self, int ifindex) gboolean nm_platform_link_supports_vlans(NMPlatform *self, int ifindex); gboolean nm_platform_link_supports_sriov(NMPlatform *self, int ifindex); -gboolean nm_platform_link_enslave(NMPlatform *self, int controller, int slave); -gboolean nm_platform_link_release(NMPlatform *self, int controller, int slave); +gboolean nm_platform_link_attach_port(NMPlatform *self, int controller, int port); +gboolean nm_platform_link_release_port(NMPlatform *self, int controller, int port); gboolean nm_platform_sysctl_controller_set_option(NMPlatform *self, int ifindex, const char *option, const char *value); char *nm_platform_sysctl_controller_get_option(NMPlatform *self, int ifindex, const char *option); -gboolean nm_platform_sysctl_slave_set_option(NMPlatform *self, - int ifindex, - const char *option, - const char *value); -char *nm_platform_sysctl_slave_get_option(NMPlatform *self, int ifindex, const char *option); +gboolean nm_platform_sysctl_port_set_option(NMPlatform *self, + int ifindex, + const char *option, + const char *value); +char *nm_platform_sysctl_port_get_option(NMPlatform *self, int ifindex, const char *option); const NMPObject *nm_platform_link_get_lnk(NMPlatform *self, int ifindex, @@ -2569,7 +2569,7 @@ void nm_platform_mptcp_addr_hash_update(const NMPlatformMptcpAddr *obj, NMHashSt guint nm_platform_mptcp_addr_index_addr_cmp(gconstpointer data); gboolean nm_platform_mptcp_addr_index_addr_equal(gconstpointer data_a, gconstpointer data_b); -#define NM_PLATFORM_LINK_FLAGS2STR_MAX_LEN ((gsize) 166) +#define NM_PLATFORM_LINK_FLAGS2STR_MAX_LEN ((gsize) 165) gboolean nm_platform_ethtool_set_wake_on_lan(NMPlatform *self, int ifindex, diff --git a/src/libnm-platform/nmp-base.c b/src/libnm-platform/nmp-base.c index fbd07bf7e..9d13b78a7 100644 --- a/src/libnm-platform/nmp-base.c +++ b/src/libnm-platform/nmp-base.c @@ -23,7 +23,7 @@ NM_UTILS_FLAGS2STR_DEFINE(nm_platform_link_flags2str, NM_UTILS_FLAGS2STR(IFF_ALLMULTI, "allmulti"), NM_UTILS_FLAGS2STR(IFF_PROMISC, "promisc"), NM_UTILS_FLAGS2STR(IFF_MASTER, "controller"), - NM_UTILS_FLAGS2STR(IFF_SLAVE, "slave"), + NM_UTILS_FLAGS2STR(IFF_SLAVE, "port"), NM_UTILS_FLAGS2STR(IFF_DEBUG, "debug"), NM_UTILS_FLAGS2STR(IFF_DYNAMIC, "dynamic"), NM_UTILS_FLAGS2STR(IFF_AUTOMEDIA, "automedia"), diff --git a/src/libnm-platform/nmp-object.c b/src/libnm-platform/nmp-object.c index 9c4e2005f..1fdaa2755 100644 --- a/src/libnm-platform/nmp-object.c +++ b/src/libnm-platform/nmp-object.c @@ -2035,12 +2035,12 @@ nmp_cache_use_udev_get(const NMPCache *cache) /*****************************************************************************/ gboolean -nmp_cache_link_connected_for_slave(int ifindex_controller, const NMPObject *slave) +nmp_cache_link_connected_for_port(int ifindex_controller, const NMPObject *port) { - nm_assert(NMP_OBJECT_GET_TYPE(slave) == NMP_OBJECT_TYPE_LINK); + nm_assert(NMP_OBJECT_GET_TYPE(port) == NMP_OBJECT_TYPE_LINK); - return ifindex_controller > 0 && slave->link.controller == ifindex_controller - && slave->link.connected && nmp_object_is_visible(slave); + return ifindex_controller > 0 && port->link.controller == ifindex_controller + && port->link.connected && nmp_object_is_visible(port); } /** @@ -2048,27 +2048,27 @@ nmp_cache_link_connected_for_slave(int ifindex_controller, const NMPObject *slav * @cache: the platform cache * @controller: the link object, that is checked whether its connected property * needs to be toggled. - * @potential_slave: (nullable): an additional link object that is treated + * @potential_port: (nullable): an additional link object that is treated * as if it was inside @cache. If given, it shaddows a link in the cache * with the same ifindex. - * @ignore_slave: (nullable): if set, the check will pretend that @ignore_slave + * @ignore_port: (nullable): if set, the check will pretend that @ignore_port * is not in the cache. * * NMPlatformLink has two connected flags: (controller->link.flags&IFF_LOWER_UP) (as reported * from netlink) and controller->link.connected. For bond and bridge controller, kernel reports - * those links as IFF_LOWER_UP if they have no slaves attached. We want to present instead - * a combined @connected flag that shows controllers without slaves as down. + * those links as IFF_LOWER_UP if they have no ports attached. We want to present instead + * a combined @connected flag that shows controllers without ports as down. * * Check if the connected flag of @controller should be toggled according to the content - * of @cache (including @potential_slave). + * of @cache (including @potential_port). * * Returns: %TRUE, if @controller->link.connected should be flipped/toggled. **/ gboolean nmp_cache_link_connected_needs_toggle(const NMPCache *cache, const NMPObject *controller, - const NMPObject *potential_slave, - const NMPObject *ignore_slave) + const NMPObject *potential_port, + const NMPObject *ignore_port) { gboolean is_lower_up = FALSE; @@ -2078,15 +2078,15 @@ nmp_cache_link_connected_needs_toggle(const NMPCache *cache, return FALSE; /* if native IFF_LOWER_UP is down, link.connected must also be down - * regardless of the slaves. */ + * regardless of the ports. */ if (!NM_FLAGS_HAS(controller->link.n_ifi_flags, IFF_LOWER_UP)) return !!controller->link.connected; - if (potential_slave && NMP_OBJECT_GET_TYPE(potential_slave) != NMP_OBJECT_TYPE_LINK) - potential_slave = NULL; + if (potential_port && NMP_OBJECT_GET_TYPE(potential_port) != NMP_OBJECT_TYPE_LINK) + potential_port = NULL; - if (potential_slave - && nmp_cache_link_connected_for_slave(controller->link.ifindex, potential_slave)) + if (potential_port + && nmp_cache_link_connected_for_port(controller->link.ifindex, potential_port)) is_lower_up = TRUE; else { NMPLookup lookup; @@ -2099,9 +2099,9 @@ nmp_cache_link_connected_needs_toggle(const NMPCache *cache, &link) { const NMPObject *obj = NMP_OBJECT_UP_CAST((NMPlatformObject *) link); - if ((!potential_slave || potential_slave->link.ifindex != link->ifindex) - && ignore_slave != obj - && nmp_cache_link_connected_for_slave(controller->link.ifindex, obj)) { + if ((!potential_port || potential_port->link.ifindex != link->ifindex) + && ignore_port != obj + && nmp_cache_link_connected_for_port(controller->link.ifindex, obj)) { is_lower_up = TRUE; break; } @@ -2115,10 +2115,10 @@ nmp_cache_link_connected_needs_toggle(const NMPCache *cache, * @cache: * @controller_ifindex: the ifindex of a potential controller that should be checked * whether it needs toggling. - * @potential_slave: (nullable): passed to nmp_cache_link_connected_needs_toggle(). - * It considers @potential_slave as being inside the cache, replacing an existing + * @potential_port: (nullable): passed to nmp_cache_link_connected_needs_toggle(). + * It considers @potential_port as being inside the cache, replacing an existing * link with the same ifindex. - * @ignore_slave: (nullable): passed to nmp_cache_link_connected_needs_toggle(). + * @ignore_port: (nullable): passed to nmp_cache_link_connected_needs_toggle(). * * The flag obj->link.connected depends on the state of other links in the * @cache. See also nmp_cache_link_connected_needs_toggle(). Given an ifindex @@ -2132,14 +2132,14 @@ nmp_cache_link_connected_needs_toggle(const NMPCache *cache, const NMPObject * nmp_cache_link_connected_needs_toggle_by_ifindex(const NMPCache *cache, int controller_ifindex, - const NMPObject *potential_slave, - const NMPObject *ignore_slave) + const NMPObject *potential_port, + const NMPObject *ignore_port) { const NMPObject *controller; if (controller_ifindex > 0) { controller = nmp_cache_lookup_link(cache, controller_ifindex); - if (nmp_cache_link_connected_needs_toggle(cache, controller, potential_slave, ignore_slave)) + if (nmp_cache_link_connected_needs_toggle(cache, controller, potential_port, ignore_port)) return controller; } return NULL; diff --git a/src/libnm-platform/nmp-object.h b/src/libnm-platform/nmp-object.h index f7514a3df..cd1793d45 100644 --- a/src/libnm-platform/nmp-object.h +++ b/src/libnm-platform/nmp-object.h @@ -952,15 +952,15 @@ const NMPObject *nmp_cache_lookup_link_full(const NMPCache *cache, NMPObjectMatchFn match_fn, gpointer user_data); -gboolean nmp_cache_link_connected_for_slave(int ifindex_controller, const NMPObject *slave); +gboolean nmp_cache_link_connected_for_port(int ifindex_controller, const NMPObject *port); gboolean nmp_cache_link_connected_needs_toggle(const NMPCache *cache, const NMPObject *controller, - const NMPObject *potential_slave, - const NMPObject *ignore_slave); + const NMPObject *potential_port, + const NMPObject *ignore_port); const NMPObject *nmp_cache_link_connected_needs_toggle_by_ifindex(const NMPCache *cache, int controller_ifindex, - const NMPObject *potential_slave, - const NMPObject *ignore_slave); + const NMPObject *potential_port, + const NMPObject *ignore_port); gboolean nmp_cache_use_udev_get(const NMPCache *cache); diff --git a/src/libnmc-base/nm-client-utils.c b/src/libnmc-base/nm-client-utils.c index a7a9b4774..4516bc3bd 100644 --- a/src/libnmc-base/nm-client-utils.c +++ b/src/libnmc-base/nm-client-utils.c @@ -575,14 +575,14 @@ nmc_activation_get_effective_state(NMActiveConnection *active, } break; case NM_ACTIVE_CONNECTION_STATE_ACTIVATING: - /* activating controller connection does not automatically activate any slaves, so their + /* activating controller connection does not automatically activate any ports, so their * active connection state will not progress beyond ACTIVATING state. * Monitor the device instead. */ if (device && (NM_IS_DEVICE_BOND(device) || NM_IS_DEVICE_TEAM(device) || NM_IS_DEVICE_BRIDGE(device)) && dev_state >= NM_DEVICE_STATE_IP_CONFIG && dev_state <= NM_DEVICE_STATE_ACTIVATED) { - *reason = "controller waiting for slaves"; + *reason = "controller waiting for ports"; return NM_ACTIVE_CONNECTION_STATE_ACTIVATED; } break; diff --git a/src/libnmc-setting/nm-meta-setting-desc.c b/src/libnmc-setting/nm-meta-setting-desc.c index 6a5ca04ff..b3a51ba00 100644 --- a/src/libnmc-setting/nm-meta-setting-desc.c +++ b/src/libnmc-setting/nm-meta-setting-desc.c @@ -2667,9 +2667,9 @@ _complete_fcn_connection_type(ARGS_COMPLETE_FCN) guint i, j; char **result; gsize text_len; - const char *slave_types[] = {"bond-slave", "bridge-slave", "team-slave"}; + const char *port_types[] = {"bond-slave", "bridge-slave", "team-slave"}; - result = g_new(char *, _NM_META_SETTING_TYPE_NUM * 2 + G_N_ELEMENTS(slave_types) + 1); + result = g_new(char *, _NM_META_SETTING_TYPE_NUM * 2 + G_N_ELEMENTS(port_types) + 1); text_len = text ? strlen(text) : 0; @@ -2694,8 +2694,8 @@ _complete_fcn_connection_type(ARGS_COMPLETE_FCN) if (!text || strncmp(text, v, text_len) == 0) result[j++] = g_strdup(v); } - for (i = 0; i < G_N_ELEMENTS(slave_types); i++) { - const char *v = slave_types[i]; + for (i = 0; i < G_N_ELEMENTS(port_types); i++) { + const char *v = port_types[i]; if (!text || strncmp(text, v, text_len) == 0) result[j++] = g_strdup(v); @@ -2781,7 +2781,7 @@ _complete_fcn_connection_controller(ARGS_COMPLETE_FCN) if ((!text || !*text) && operation_context && operation_context->connection) { /* if we have no text yet, initially only complete for matching - * slave-type. */ + * port-type. */ s_con = nm_connection_get_setting_connection(operation_context->connection); if (s_con) expected_type = nm_setting_connection_get_port_type(s_con); @@ -9091,7 +9091,7 @@ const NMMetaSettingValidPartItem *const nm_meta_setting_info_valid_parts_default /*****************************************************************************/ -static const NMMetaSettingValidPartItem *const valid_settings_noslave[] = { +static const NMMetaSettingValidPartItem *const valid_settings_noport[] = { NM_META_SETTING_VALID_PART_ITEM(MATCH, FALSE), NM_META_SETTING_VALID_PART_ITEM(IP4_CONFIG, FALSE), NM_META_SETTING_VALID_PART_ITEM(IP6_CONFIG, FALSE), @@ -9102,33 +9102,33 @@ static const NMMetaSettingValidPartItem *const valid_settings_noslave[] = { NULL, }; -static const NMMetaSettingValidPartItem *const valid_settings_slave_bond[] = { +static const NMMetaSettingValidPartItem *const valid_settings_port_bond[] = { NM_META_SETTING_VALID_PART_ITEM(BOND_PORT, TRUE), NM_META_SETTING_VALID_PART_ITEM(LINK, FALSE), NM_META_SETTING_VALID_PART_ITEM(MATCH, FALSE), NULL, }; -static const NMMetaSettingValidPartItem *const valid_settings_slave_bridge[] = { +static const NMMetaSettingValidPartItem *const valid_settings_port_bridge[] = { NM_META_SETTING_VALID_PART_ITEM(BRIDGE_PORT, TRUE), NM_META_SETTING_VALID_PART_ITEM(LINK, FALSE), NM_META_SETTING_VALID_PART_ITEM(MATCH, FALSE), NULL, }; -static const NMMetaSettingValidPartItem *const valid_settings_slave_ovs_bridge[] = { +static const NMMetaSettingValidPartItem *const valid_settings_port_ovs_bridge[] = { NM_META_SETTING_VALID_PART_ITEM(OVS_PORT, FALSE), NULL, }; -static const NMMetaSettingValidPartItem *const valid_settings_slave_ovs_port[] = { +static const NMMetaSettingValidPartItem *const valid_settings_port_ovs_port[] = { NM_META_SETTING_VALID_PART_ITEM(LINK, FALSE), NM_META_SETTING_VALID_PART_ITEM(MATCH, FALSE), NM_META_SETTING_VALID_PART_ITEM(OVS_INTERFACE, FALSE), NULL, }; -static const NMMetaSettingValidPartItem *const valid_settings_slave_team[] = { +static const NMMetaSettingValidPartItem *const valid_settings_port_team[] = { NM_META_SETTING_VALID_PART_ITEM(LINK, FALSE), NM_META_SETTING_VALID_PART_ITEM(MATCH, FALSE), NM_META_SETTING_VALID_PART_ITEM(TEAM_PORT, TRUE), @@ -9136,35 +9136,35 @@ static const NMMetaSettingValidPartItem *const valid_settings_slave_team[] = { }; const NMMetaSettingValidPartItem *const * -nm_meta_setting_info_valid_parts_for_slave_type(const char *slave_type, const char **out_slave_name) +nm_meta_setting_info_valid_parts_for_port_type(const char *port_type, const char **out_port_name) { - if (!slave_type) { - NM_SET_OUT(out_slave_name, NULL); - return valid_settings_noslave; + if (!port_type) { + NM_SET_OUT(out_port_name, NULL); + return valid_settings_noport; } - if (nm_streq(slave_type, NM_SETTING_BOND_SETTING_NAME)) { - NM_SET_OUT(out_slave_name, "bond-slave"); - return valid_settings_slave_bond; + if (nm_streq(port_type, NM_SETTING_BOND_SETTING_NAME)) { + NM_SET_OUT(out_port_name, "bond-slave"); + return valid_settings_port_bond; } - if (nm_streq(slave_type, NM_SETTING_BRIDGE_SETTING_NAME)) { - NM_SET_OUT(out_slave_name, "bridge-slave"); - return valid_settings_slave_bridge; + if (nm_streq(port_type, NM_SETTING_BRIDGE_SETTING_NAME)) { + NM_SET_OUT(out_port_name, "bridge-slave"); + return valid_settings_port_bridge; } - if (nm_streq(slave_type, NM_SETTING_OVS_BRIDGE_SETTING_NAME)) { - NM_SET_OUT(out_slave_name, "ovs-slave"); - return valid_settings_slave_ovs_bridge; + if (nm_streq(port_type, NM_SETTING_OVS_BRIDGE_SETTING_NAME)) { + NM_SET_OUT(out_port_name, "ovs-slave"); + return valid_settings_port_ovs_bridge; } - if (nm_streq(slave_type, NM_SETTING_OVS_PORT_SETTING_NAME)) { - NM_SET_OUT(out_slave_name, "ovs-slave"); - return valid_settings_slave_ovs_port; + if (nm_streq(port_type, NM_SETTING_OVS_PORT_SETTING_NAME)) { + NM_SET_OUT(out_port_name, "ovs-slave"); + return valid_settings_port_ovs_port; } - if (nm_streq(slave_type, NM_SETTING_TEAM_SETTING_NAME)) { - NM_SET_OUT(out_slave_name, "team-slave"); - return valid_settings_slave_team; + if (nm_streq(port_type, NM_SETTING_TEAM_SETTING_NAME)) { + NM_SET_OUT(out_port_name, "team-slave"); + return valid_settings_port_team; } - if (nm_streq(slave_type, NM_SETTING_VRF_SETTING_NAME)) { - NM_SET_OUT(out_slave_name, "vrf-slave"); - return valid_settings_noslave; + if (nm_streq(port_type, NM_SETTING_VRF_SETTING_NAME)) { + NM_SET_OUT(out_port_name, "vrf-slave"); + return valid_settings_noport; } return NULL; } diff --git a/src/libnmc-setting/nm-meta-setting-desc.h b/src/libnmc-setting/nm-meta-setting-desc.h index f8e36b0e0..21d913826 100644 --- a/src/libnmc-setting/nm-meta-setting-desc.h +++ b/src/libnmc-setting/nm-meta-setting-desc.h @@ -503,8 +503,7 @@ extern const NMMetaSettingInfoEditor nm_meta_setting_infos_editor[_NM_META_SETTI extern const NMMetaSettingValidPartItem *const nm_meta_setting_info_valid_parts_default[]; const NMMetaSettingValidPartItem *const * -nm_meta_setting_info_valid_parts_for_slave_type(const char *slave_type, - const char **out_slave_name); +nm_meta_setting_info_valid_parts_for_port_type(const char *port_type, const char **out_port_name); gboolean nm_meta_property_int_get_range(const NMMetaPropertyInfo *property_info, NMMetaSignUnsignInt64 *out_min, diff --git a/src/libnmc-setting/settings-docs.h.in b/src/libnmc-setting/settings-docs.h.in index ba6d92542..091dcd64d 100644 --- a/src/libnmc-setting/settings-docs.h.in +++ b/src/libnmc-setting/settings-docs.h.in @@ -5,7 +5,7 @@ #define DESCRIBE_DOC_NM_SETTING_CONNECTION_AUTOCONNECT_PORTS N_("Whether or not ports of this connection should be automatically brought up when NetworkManager activates this connection. This only has a real effect for controller connections. The properties \"autoconnect\", \"autoconnect-priority\" and \"autoconnect-retries\" are unrelated to this setting. 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-ports is read to determine the real value. If it is default as well, this fallbacks to 0.") #define DESCRIBE_DOC_NM_SETTING_CONNECTION_AUTOCONNECT_PRIORITY N_("The autoconnect priority in range -999 to 999. If the connection is set to autoconnect, connections with higher priority will be preferred. The higher number means higher priority. Defaults to 0. Note that this property only matters if there are more than one candidate profile to select for autoconnect. In case of equal priority, the profile used most recently is chosen.") #define DESCRIBE_DOC_NM_SETTING_CONNECTION_AUTOCONNECT_RETRIES N_("The number of times a connection should be tried when autoactivating before giving up. Zero means forever, -1 means the global default (4 times if not overridden). Setting this to 1 means to try activation only once before blocking autoconnect. Note that after a timeout, NetworkManager will try to autoconnect again.") -#define DESCRIBE_DOC_NM_SETTING_CONNECTION_AUTOCONNECT_SLAVES N_("Whether or not slaves of this connection should be automatically brought up when NetworkManager activates this connection. This only has a real effect for controller connections. The properties \"autoconnect\", \"autoconnect-priority\" and \"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. 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. Deprecated 1.46. Use \"autoconnect-ports\" instead, this is just an alias.") +#define DESCRIBE_DOC_NM_SETTING_CONNECTION_AUTOCONNECT_SLAVES N_("Whether or not ports of this connection should be automatically brought up when NetworkManager activates this connection. This only has a real effect for controller connections. The properties \"autoconnect\", \"autoconnect-priority\" and \"autoconnect-retries\" are unrelated to this setting. 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. Deprecated 1.46. Use \"autoconnect-ports\" instead, this is just an alias.") #define DESCRIBE_DOC_NM_SETTING_CONNECTION_CONTROLLER N_("Interface name of the controller device or UUID of the controller connection.") #define DESCRIBE_DOC_NM_SETTING_CONNECTION_DNS_OVER_TLS N_("Whether DNSOverTls (dns-over-tls) is enabled for the connection. DNSOverTls is a technology which uses TLS to encrypt dns traffic. The permitted values are: \"yes\" (2) use DNSOverTls and disabled fallback, \"opportunistic\" (1) use DNSOverTls but allow fallback to unencrypted resolution, \"no\" (0) don't ever use DNSOverTls. If unspecified \"default\" depends on the plugin used. Systemd-resolved uses global setting. This feature requires a plugin which supports DNSOverTls. Otherwise, the setting has no effect. One such plugin is dns-systemd-resolved.") #define DESCRIBE_DOC_NM_SETTING_CONNECTION_DOWN_ON_POWEROFF N_("Whether the connection will be brought down before the system is powered off. The default value is \"default\" (-1). When the default value is specified, then the global value from NetworkManager configuration is looked up, if not set, it is considered as \"no\" (0).") @@ -24,7 +24,7 @@ #define DESCRIBE_DOC_NM_SETTING_CONNECTION_PORT_TYPE N_("Setting name of the device type of this port's controller connection (eg, \"bond\"), or NULL if this connection is not a port.") #define DESCRIBE_DOC_NM_SETTING_CONNECTION_READ_ONLY N_("This property is deprecated and has no meaning.") #define DESCRIBE_DOC_NM_SETTING_CONNECTION_SECONDARIES N_("List of connection UUIDs that should be activated when the base connection itself is activated. Currently, only VPN connections are supported.") -#define DESCRIBE_DOC_NM_SETTING_CONNECTION_SLAVE_TYPE N_("Setting name of the device type of this slave's controller connection (eg, \"bond\"), or NULL if this connection is not a slave. Deprecated 1.46. Use \"port-type\" instead, this is just an alias.") +#define DESCRIBE_DOC_NM_SETTING_CONNECTION_SLAVE_TYPE N_("Setting name of the device type of this port's controller connection (eg, \"bond\"), or NULL if this connection is not a port. Deprecated 1.46. Use \"port-type\" instead, this is just an alias.") #define DESCRIBE_DOC_NM_SETTING_CONNECTION_STABLE_ID N_("This represents the identity of the connection used for various purposes. It allows to configure multiple profiles to share the identity. Also, the stable-id can contain placeholders that are substituted dynamically and deterministically depending on the context. The stable-id is used for generating IPv6 stable private addresses with ipv6.addr-gen-mode=stable-privacy. It is also used to seed the generated cloned MAC address for ethernet.cloned-mac-address=stable and wifi.cloned-mac-address=stable. It is also used to derive the DHCP client identifier with ipv4.dhcp-client-id=stable, the DHCPv6 DUID with ipv6.dhcp-duid=stable-[llt,ll,uuid] and the DHCP IAID with ipv4.iaid=stable and ipv6.iaid=stable. Note that depending on the context where it is used, other parameters are also seeded into the generation algorithm. For example, a per-host key is commonly also included, so that different systems end up generating different IDs. Or with ipv6.addr-gen-mode=stable-privacy, also the device's name is included, so that different interfaces yield different addresses. The per-host key is the identity of your machine and stored in /var/lib/NetworkManager/secret_key. See NetworkManager(8) manual about the secret-key and the host identity. The '$' character is treated special to perform dynamic substitutions at activation time. Currently, supported are \"${CONNECTION}\", \"${DEVICE}\", \"${MAC}\", \"${NETWORK_SSID}\", \"${BOOT}\", \"${RANDOM}\". These effectively create unique IDs per-connection, per-device, per-SSID, per-boot, or every time. The \"${CONNECTION}\" uses the profile's connection.uuid, the \"${DEVICE}\" uses the interface name of the device and \"${MAC}\" the permanent MAC address of the device. \"${NETWORK_SSID}\" uses the SSID for Wi-Fi networks and falls back to \"${CONNECTION}\" on other networks. Any unrecognized patterns following '$' are treated verbatim, however are reserved for future use. You are thus advised to avoid '$' or escape it as \"$$\". For example, set it to \"${CONNECTION}-${BOOT}-${DEVICE}\" to create a unique id for this connection that changes with every reboot and differs depending on the interface where the profile activates. If the value is unset, a global connection default is consulted. If the value is still unset, the default is \"default${CONNECTION}\" go generate an ID unique per connection profile.") #define DESCRIBE_DOC_NM_SETTING_CONNECTION_TIMESTAMP N_("The time, in seconds since the Unix Epoch, that the connection was last _successfully_ fully activated. NetworkManager updates the connection timestamp periodically when the connection is active to ensure that an active connection has the latest timestamp. The property is only meant for reading (changes to this property will not be preserved).") #define DESCRIBE_DOC_NM_SETTING_CONNECTION_TYPE N_("Base type of the connection. For hardware-dependent connections, should contain the setting name of the hardware-type specific setting (ie, \"802-3-ethernet\" or \"802-11-wireless\" or \"bluetooth\", etc), and for non-hardware dependent connections like VPN or otherwise, should contain the setting name of that setting type (ie, \"vpn\" or \"bridge\", etc).") diff --git a/src/nm-initrd-generator/nmi-cmdline-reader.c b/src/nm-initrd-generator/nmi-cmdline-reader.c index 08656c257..3703ff0cb 100644 --- a/src/nm-initrd-generator/nmi-cmdline-reader.c +++ b/src/nm-initrd-generator/nmi-cmdline-reader.c @@ -232,7 +232,7 @@ reader_get_connection(Reader *reader, /* * If ifname was not given, we'll match the connection by type. - * If the type was not given either, then we're happy with any connection but slaves. + * If the type was not given either, then we're happy with any connection but ports. * This is so that things like "bond=bond0:eth1,eth2 nameserver=1.3.3.7 end up * slapping the nameserver to the most reasonable connection (bond0). */ @@ -875,15 +875,15 @@ reader_parse_controller(Reader *reader, NMSettingConnection *s_con; gs_free char *controller_to_free = NULL; const char *controller; - char *slaves; - const char *slave; + char *ports; + const char *port; char *opts; const char *mtu = NULL; controller = get_word(&argument, ':'); if (!controller) controller = controller_to_free = g_strdup_printf("%s0", default_name ?: type_name); - slaves = get_word(&argument, ':'); + ports = get_word(&argument, ':'); connection = reader_get_connection(reader, controller, type_name, TRUE); s_con = nm_connection_get_setting_connection(connection); @@ -924,11 +924,11 @@ reader_parse_controller(Reader *reader, connection_set(connection, NM_SETTING_WIRED_SETTING_NAME, NM_SETTING_WIRED_MTU, mtu); do { - slave = get_word(&slaves, ','); - if (slave == NULL) - slave = "eth0"; + port = get_word(&ports, ','); + if (port == NULL) + port = "eth0"; - connection = reader_get_connection(reader, slave, NULL, TRUE); + connection = reader_get_connection(reader, port, NULL, TRUE); s_con = nm_connection_get_setting_connection(connection); g_object_set(s_con, NM_SETTING_CONNECTION_PORT_TYPE, @@ -936,7 +936,7 @@ reader_parse_controller(Reader *reader, NM_SETTING_CONNECTION_CONTROLLER, controller, NULL); - } while (slaves && *slaves != '\0'); + } while (ports && *ports != '\0'); if (argument && *argument) _LOGW(LOGD_CORE, "Ignoring extra: '%s'.", argument); diff --git a/src/nmcli/connections.c b/src/nmcli/connections.c index 2505190c6..55e99fcfa 100644 --- a/src/nmcli/connections.c +++ b/src/nmcli/connections.c @@ -1120,7 +1120,7 @@ usage(void) " up [[id | uuid | path] ] [ifname ] [ap ] [passwd-file ]\n\n" " down [id | uuid | path | apath] ...\n\n" - " add COMMON_OPTIONS TYPE_SPECIFIC_OPTIONS SLAVE_OPTIONS IP_OPTIONS [-- " + " add COMMON_OPTIONS TYPE_SPECIFIC_OPTIONS PORT_OPTIONS IP_OPTIONS [-- " "([+|-]. )+]\n\n" " modify [--temporary] [id | uuid | path] ([+|-]. )+\n\n" " clone [--temporary] [id | uuid | path ] \n\n" @@ -1199,7 +1199,7 @@ usage_connection_add(void) nmc_printerr( _("Usage: nmcli connection add { ARGUMENTS | help }\n" "\n" - "ARGUMENTS := COMMON_OPTIONS TYPE_SPECIFIC_OPTIONS SLAVE_OPTIONS IP_OPTIONS [-- " + "ARGUMENTS := COMMON_OPTIONS TYPE_SPECIFIC_OPTIONS PORT_OPTIONS IP_OPTIONS [-- " "([+|-]. )+]\n\n" " COMMON_OPTIONS:\n" " type \n" @@ -1208,7 +1208,7 @@ usage_connection_add(void) " [autoconnect yes|no]\n" " [save yes|no]\n" " [controller ]\n" - " [slave-type ]\n\n" + " [port-type ]\n\n" " TYPE_SPECIFIC_OPTIONS:\n" " ethernet: [mac ]\n" " [cloned-mac ]\n" @@ -1312,7 +1312,7 @@ usage_connection_add(void) " [mac ]\n\n" " 6lowpan: dev \n" " dummy:\n\n" - " SLAVE_OPTIONS:\n" + " PORT_OPTIONS:\n" " bridge: [priority <0-63>]\n" " [path-cost <1-65535>]\n" " [hairpin yes|no]\n\n" @@ -3534,7 +3534,7 @@ get_name_alias_toplevel(const char *name, const char *port_type) if (port_type) { const char *port_name; - if (nm_meta_setting_info_valid_parts_for_slave_type(port_type, &port_name)) + if (nm_meta_setting_info_valid_parts_for_port_type(port_type, &port_name)) return port_name ?: name; return name; } @@ -3882,7 +3882,7 @@ is_setting_mandatory(NMConnection *connection, NMSetting *setting) if (i == 0) item = get_valid_settings_array(c_type); else - item = nm_meta_setting_info_valid_parts_for_slave_type(s_type, NULL); + item = nm_meta_setting_info_valid_parts_for_port_type(s_type, NULL); for (; item && *item; item++) { if (nm_streq(name, (*item)->setting_info->general->setting_name)) return (*item)->mandatory; @@ -4465,12 +4465,12 @@ con_settings(NMConnection *connection, g_return_val_if_fail(s_con, FALSE); con_type = nm_setting_connection_get_port_type(s_con); - *port_settings = nm_meta_setting_info_valid_parts_for_slave_type(con_type, NULL); + *port_settings = nm_meta_setting_info_valid_parts_for_port_type(con_type, NULL); if (!*port_settings) { g_set_error(error, NMCLI_ERROR, NMC_RESULT_ERROR_USER_INPUT, - _("Error: invalid slave type; %s."), + _("Error: invalid port type; %s."), con_type); return FALSE; } @@ -5030,7 +5030,7 @@ complete_property_name(NmCli *nmc, if (s_con) port_type = nm_setting_connection_get_port_type(s_con); valid_settings_main = get_valid_settings_array(connection_type); - valid_settings_port = nm_meta_setting_info_valid_parts_for_slave_type(port_type, NULL); + valid_settings_port = nm_meta_setting_info_valid_parts_for_port_type(port_type, NULL); word_list = get_valid_properties_string(valid_settings_main, valid_settings_port, @@ -6249,7 +6249,7 @@ gen_setting_names(const char *text, int state) return g_strdup(s_name); } - /* Let's give a try to parameters related to slave type */ + /* Let's give a try to parameters related to port type */ list_idx = 0; is_port = 1; } @@ -6258,7 +6258,7 @@ gen_setting_names(const char *text, int state) s_con = nm_connection_get_setting_connection(nmc_tab_completion.connection); if (s_con) s_type = nm_setting_connection_get_port_type(s_con); - valid_settings_arr = nm_meta_setting_info_valid_parts_for_slave_type(s_type, NULL); + valid_settings_arr = nm_meta_setting_info_valid_parts_for_port_type(s_type, NULL); if (list_idx < NM_PTRARRAY_LEN(valid_settings_arr)) { while (valid_settings_arr[list_idx]) { @@ -6315,7 +6315,7 @@ gen_property_names(const char *text, int state) port_type = NM_SETTING_BOND_SETTING_NAME; else port_type = NULL; - valid_settings_port = nm_meta_setting_info_valid_parts_for_slave_type(port_type, NULL); + valid_settings_port = nm_meta_setting_info_valid_parts_for_port_type(port_type, NULL); setting_name = check_valid_name(strv[0], valid_settings_main, valid_settings_port, NULL); if (setting_name) { @@ -6627,7 +6627,7 @@ get_setting_and_property(const char *prompt, s_type = nm_setting_connection_get_port_type(s_con); valid_settings_main = get_valid_settings_array(nmc_tab_completion.con_type); - valid_settings_port = nm_meta_setting_info_valid_parts_for_slave_type(s_type, NULL); + valid_settings_port = nm_meta_setting_info_valid_parts_for_port_type(s_type, NULL); setting_name = check_valid_name(sett, valid_settings_main, valid_settings_port, NULL); setting = nm_meta_setting_info_editor_new_setting( @@ -7998,7 +7998,7 @@ editor_menu_main(NmCli *nmc, NMConnection *connection, const char *connection_ty s_type = nm_setting_connection_get_port_type(s_con); valid_settings_main = get_valid_settings_array(connection_type); - valid_settings_port = nm_meta_setting_info_valid_parts_for_slave_type(s_type, NULL); + valid_settings_port = nm_meta_setting_info_valid_parts_for_port_type(s_type, NULL); valid_settings_str = get_valid_options_string(valid_settings_main, valid_settings_port); nmc_print(_("You may edit the following settings: %s\n"), valid_settings_str); diff --git a/src/nmcli/gen-metadata-nm-settings-nmcli.xml.in b/src/nmcli/gen-metadata-nm-settings-nmcli.xml.in index a84afa551..7f5bc2c7a 100644 --- a/src/nmcli/gen-metadata-nm-settings-nmcli.xml.in +++ b/src/nmcli/gen-metadata-nm-settings-nmcli.xml.in @@ -675,7 +675,7 @@ format="string" /> controller, priv->type_filter,