mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-20 17:30:04 +01:00
src: drop most master references from the code
While we cannot remove all the references to "master" we can remove most of them.
This commit is contained in:
parent
47283b7c76
commit
090d617017
77 changed files with 1453 additions and 1401 deletions
|
|
@ -218,7 +218,7 @@ no-auto-default=*
|
|||
if specified (See <xref linkend="ignore-carrier"/>).
|
||||
Otherwise, it is a list of matches to specify for which device
|
||||
carrier should be ignored. See <xref linkend="device-spec"/> for the
|
||||
syntax how to specify a device. Note that master types like
|
||||
syntax how to specify a device. Note that controller types like
|
||||
bond, bridge, and team ignore carrier by default. You can however
|
||||
revert that default using the "except:" specifier (or better,
|
||||
use the per-device setting instead of the deprecated setting).
|
||||
|
|
|
|||
|
|
@ -123,10 +123,10 @@
|
|||
<example><title>Creating a Bridge with a single internal Interface</title>
|
||||
<screen><prompt>$ </prompt><userinput>nmcli conn add type ovs-bridge conn.interface bridge0</userinput>
|
||||
Connection 'ovs-bridge-bridge0' (d10fc64d-1d48-4394-a1b8-e1aea72f27d5) successfully added.
|
||||
<prompt>$ </prompt><userinput>nmcli conn add type ovs-port conn.interface port0 master bridge0</userinput>
|
||||
<prompt>$ </prompt><userinput>nmcli conn add type ovs-port conn.interface port0 controller bridge0</userinput>
|
||||
Connection 'ovs-port-port0' (5ae22bae-bba4-4815-9ade-7e635633e1f0) successfully added.
|
||||
<prompt>$ </prompt><userinput>nmcli conn add type ovs-interface slave-type ovs-port conn.interface iface0 \
|
||||
master port0 ipv4.method manual ipv4.address 192.0.2.1/24</userinput>
|
||||
controller port0 ipv4.method manual ipv4.address 192.0.2.1/24</userinput>
|
||||
Connection 'ovs-interface-iface0' (3640d2a1-a2fd-4718-92f1-cffadb5b6cdc) successfully added.
|
||||
</screen>
|
||||
<para>As said above, you need to create a Port even for a single interface.
|
||||
|
|
@ -136,29 +136,29 @@ Connection 'ovs-interface-iface0' (3640d2a1-a2fd-4718-92f1-cffadb5b6cdc) success
|
|||
</example>
|
||||
|
||||
<example><title>Adding a Linux interface to a Bridge</title>
|
||||
<screen><prompt>$ </prompt><userinput>nmcli conn add type ovs-port conn.interface port1 master bridge0</userinput>
|
||||
<screen><prompt>$ </prompt><userinput>nmcli conn add type ovs-port conn.interface port1 controller bridge0</userinput>
|
||||
Connection 'ovs-port-port1' (67d041eb-8e7b-4458-afee-a1d07c9c4552) successfully added.
|
||||
<prompt>$ </prompt><userinput>nmcli conn add type ethernet conn.interface eth0 master port1</userinput>
|
||||
<prompt>$ </prompt><userinput>nmcli conn add type ethernet conn.interface eth0 controller port1</userinput>
|
||||
Connection 'ovs-slave-eth0' (d459c45c-cf78-4c1c-b4b7-505e71379624) successfully added.
|
||||
</screen>
|
||||
<para>Again, you need a port.</para>
|
||||
</example>
|
||||
|
||||
<example><title>Creating a VLAN</title>
|
||||
<screen><prompt>$ </prompt><userinput>nmcli conn add type ovs-port conn.interface port2 master bridge0 ovs-port.tag 120</userinput>
|
||||
<screen><prompt>$ </prompt><userinput>nmcli conn add type ovs-port conn.interface port2 controller bridge0 ovs-port.tag 120</userinput>
|
||||
Connection 'ovs-port-port2' (3994c093-4ef7-4549-a4fd-627b831c3cb8) successfully added.
|
||||
<prompt>$ </prompt><userinput>nmcli conn add type ethernet conn.interface eth1 master port2</userinput>
|
||||
<prompt>$ </prompt><userinput>nmcli conn add type ethernet conn.interface eth1 controller port2</userinput>
|
||||
Connection 'ovs-slave-eth1' (099be06e-71ad-484d-8d5a-fcadc5f207f5) successfully added.
|
||||
</screen>
|
||||
<para>It's just a port with a tag.</para>
|
||||
</example>
|
||||
|
||||
<example><title>Creating a Bond</title>
|
||||
<screen><prompt>$ </prompt><userinput>nmcli conn add type ovs-port conn.interface bond0 master bridge0</userinput>
|
||||
<screen><prompt>$ </prompt><userinput>nmcli conn add type ovs-port conn.interface bond0 controller bridge0</userinput>
|
||||
Connection 'ovs-port-bond0' (d154ebf9-e999-4e1b-a084-a3de53d25d8a) successfully added.
|
||||
<prompt>$ </prompt><userinput>nmcli conn add type ethernet conn.interface eth2 master bond0</userinput>
|
||||
<prompt>$ </prompt><userinput>nmcli conn add type ethernet conn.interface eth2 controller bond0</userinput>
|
||||
Connection 'ovs-slave-eth2' (475ac1bf-30b2-4534-a877-27f33f58b082) successfully added.
|
||||
<prompt>$ </prompt><userinput>nmcli conn add type ethernet conn.interface eth3 master bond0</userinput>
|
||||
<prompt>$ </prompt><userinput>nmcli conn add type ethernet conn.interface eth3 controller bond0</userinput>
|
||||
Connection 'ovs-slave-eth3' (8dedeecb-ed12-482b-b77a-24a4fb835136) successfully added.
|
||||
</screen>
|
||||
<para>It's just a Port with multiple interfaces. See nm-settings-nmcli manual for
|
||||
|
|
|
|||
|
|
@ -173,7 +173,7 @@ id=MainBridge id=br-port-1
|
|||
uuid=171ae855-a0ab-42b6-bd0c-60f5812eea9d uuid=d6e8ae98-71f8-4b3d-9d2d-2e26048fe794
|
||||
interface-name=MainBridge interface-name=em1
|
||||
type=bridge type=ethernet
|
||||
master=MainBridge
|
||||
controller=MainBridge
|
||||
[bridge] slave-type=bridge
|
||||
interface-name=MainBridge
|
||||
</programlisting>
|
||||
|
|
|
|||
|
|
@ -187,13 +187,13 @@ B,DISPATCH</screen>
|
|||
</para>
|
||||
</example>
|
||||
|
||||
<example><title>Adding a bonding master and two slave connection profiles</title>
|
||||
<example><title>Adding a bonding controller and two slave connection profiles</title>
|
||||
<screen><prompt>$ </prompt><userinput>nmcli con add type bond ifname mybond0 mode active-backup</userinput>
|
||||
<prompt>$ </prompt><userinput>nmcli con add type ethernet ifname eth1 master mybond0</userinput>
|
||||
<prompt>$ </prompt><userinput>nmcli con add type ethernet ifname eth2 master mybond0</userinput></screen>
|
||||
<prompt>$ </prompt><userinput>nmcli con add type ethernet ifname eth1 controller mybond0</userinput>
|
||||
<prompt>$ </prompt><userinput>nmcli con add type ethernet ifname eth2 controller mybond0</userinput></screen>
|
||||
<para>
|
||||
This example demonstrates adding a bond master connection and two slaves. The
|
||||
first command adds a master bond connection, naming the bonding interface
|
||||
This example demonstrates adding a bond controller connection and two slaves. The
|
||||
first command adds a controller bond connection, naming the bonding interface
|
||||
<emphasis>mybond0</emphasis> and using <emphasis>active-backup</emphasis> mode.
|
||||
The next two commands add slaves connections, both enslaved to <emphasis>mybond0</emphasis>.
|
||||
The first slave will be bound to <emphasis>eth1</emphasis> interface, the second to
|
||||
|
|
@ -201,17 +201,17 @@ B,DISPATCH</screen>
|
|||
</para>
|
||||
</example>
|
||||
|
||||
<example><title>Adding a team master and two slave connection profiles</title>
|
||||
<screen><prompt>$ </prompt><userinput>nmcli con add type team con-name Team1 ifname Team1 config team1-master-json.conf</userinput>
|
||||
<prompt>$ </prompt><userinput>nmcli con add type ethernet con-name Team1-slave1 ifname em1 master Team1</userinput>
|
||||
<prompt>$ </prompt><userinput>nmcli con add type ethernet con-name Team1-slave2 ifname em2 master Team1</userinput></screen>
|
||||
<example><title>Adding a team controller and two slave connection profiles</title>
|
||||
<screen><prompt>$ </prompt><userinput>nmcli con add type team con-name Team1 ifname Team1 config team1-controller-json.conf</userinput>
|
||||
<prompt>$ </prompt><userinput>nmcli con add type ethernet con-name Team1-slave1 ifname em1 controller Team1</userinput>
|
||||
<prompt>$ </prompt><userinput>nmcli con add type ethernet con-name Team1-slave2 ifname em2 controller Team1</userinput></screen>
|
||||
<para>
|
||||
This example demonstrates adding a team master connection profile and two slaves. It is
|
||||
very similar to the bonding example. The first command adds a master team profile, naming
|
||||
This example demonstrates adding a team controller connection profile and two slaves. It is
|
||||
very similar to the bonding example. The first command adds a controller team profile, naming
|
||||
the team interface and the profile <emphasis>Team1</emphasis>. The team configuration
|
||||
for the master is read from <emphasis>team1-master-json.conf</emphasis> file. Later, you can
|
||||
for the controller is read from <emphasis>team1-controller-json.conf</emphasis> file. Later, you can
|
||||
change the configuration with <emphasis>modify</emphasis> command
|
||||
(<emphasis role="bold">nmcli con modify Team1 team.config team1-master-another-json.conf</emphasis>).
|
||||
(<emphasis role="bold">nmcli con modify Team1 team.config team1-controller-another-json.conf</emphasis>).
|
||||
The last two commands add slaves profiles, both enslaved to <emphasis>Team1</emphasis>.
|
||||
The first slave will be bound to the <emphasis>em1</emphasis> interface, the second to
|
||||
<emphasis>em2</emphasis>. The slaves don't specify <emphasis>config</emphasis> and thus
|
||||
|
|
@ -227,12 +227,12 @@ B,DISPATCH</screen>
|
|||
|
||||
<example><title>Adding a bridge and two slave profiles</title>
|
||||
<screen><prompt>$ </prompt><userinput>nmcli con add type bridge con-name TowerBridge ifname TowerBridge</userinput>
|
||||
<prompt>$ </prompt><userinput>nmcli con add type ethernet con-name br-slave-1 ifname ens3 master TowerBridge</userinput>
|
||||
<prompt>$ </prompt><userinput>nmcli con add type ethernet con-name br-slave-2 ifname ens4 master TowerBridge</userinput>
|
||||
<prompt>$ </prompt><userinput>nmcli con add type ethernet con-name br-slave-1 ifname ens3 controller TowerBridge</userinput>
|
||||
<prompt>$ </prompt><userinput>nmcli con add type ethernet con-name br-slave-2 ifname ens4 controller TowerBridge</userinput>
|
||||
<prompt>$ </prompt><userinput>nmcli con modify TowerBridge bridge.stp no</userinput></screen>
|
||||
<para>
|
||||
This example demonstrates adding a bridge master connection and two slaves. The
|
||||
first command adds a master bridge connection, naming the bridge interface and
|
||||
This example demonstrates adding a bridge controller connection and two slaves. The
|
||||
first command adds a controller bridge connection, naming the bridge interface and
|
||||
the profile as <emphasis>TowerBridge</emphasis>.
|
||||
The next two commands add slaves profiles, both will be enslaved to
|
||||
<emphasis>TowerBridge</emphasis>.
|
||||
|
|
@ -375,7 +375,7 @@ connection.timestamp: 0
|
|||
connection.read-only: no
|
||||
connection.permissions:
|
||||
connection.zone: --
|
||||
connection.master: --
|
||||
connection.controller: --
|
||||
connection.slave-type: --
|
||||
connection.secondaries:
|
||||
connection.gateway-ping-timeout: 0
|
||||
|
|
@ -465,7 +465,7 @@ connection.timestamp: 0
|
|||
connection.read-only: no
|
||||
connection.permissions:
|
||||
connection.zone: --
|
||||
connection.master: --
|
||||
connection.controller: --
|
||||
connection.slave-type: --
|
||||
connection.secondaries:
|
||||
connection.gateway-ping-timeout: 0
|
||||
|
|
@ -525,7 +525,7 @@ connection.timestamp: 0
|
|||
connection.read-only: no
|
||||
connection.permissions:
|
||||
connection.zone: --
|
||||
connection.master: --
|
||||
connection.controller: --
|
||||
connection.slave-type: --
|
||||
connection.secondaries:
|
||||
connection.gateway-ping-timeout: 0
|
||||
|
|
|
|||
|
|
@ -1031,7 +1031,7 @@
|
|||
sort |
|
||||
awk '
|
||||
/^(bond|bridge|team)-slave$/ {
|
||||
printf " <listitem><para><literal>%s</literal> (deprecated for ethernet with master)</para></listitem>\n", $0;
|
||||
printf " <listitem><para><literal>%s</literal> (deprecated for ethernet with controller)</para></listitem>\n", $0;
|
||||
next;
|
||||
}
|
||||
/^(wifi|ethernet|olpc-mash)$/ {
|
||||
|
|
@ -1059,9 +1059,9 @@
|
|||
<listitem><para><literal>adsl</literal></para></listitem>
|
||||
<listitem><para><literal>bluetooth</literal></para></listitem>
|
||||
<listitem><para><literal>bond</literal></para></listitem>
|
||||
<listitem><para><literal>bond-slave</literal> (deprecated for ethernet with master)</para></listitem>
|
||||
<listitem><para><literal>bond-slave</literal> (deprecated for ethernet with controller)</para></listitem>
|
||||
<listitem><para><literal>bridge</literal></para></listitem>
|
||||
<listitem><para><literal>bridge-slave</literal> (deprecated for ethernet with master)</para></listitem>
|
||||
<listitem><para><literal>bridge-slave</literal> (deprecated for ethernet with controller)</para></listitem>
|
||||
<listitem><para><literal>cdma</literal></para></listitem>
|
||||
<listitem><para><literal>dummy</literal></para></listitem>
|
||||
<listitem><para><literal>generic</literal></para></listitem>
|
||||
|
|
@ -1078,7 +1078,7 @@
|
|||
<listitem><para><literal>ovs-port</literal></para></listitem>
|
||||
<listitem><para><literal>pppoe</literal></para></listitem>
|
||||
<listitem><para><literal>team</literal></para></listitem>
|
||||
<listitem><para><literal>team-slave</literal> (deprecated for ethernet with master)</para></listitem>
|
||||
<listitem><para><literal>team-slave</literal> (deprecated for ethernet with controller)</para></listitem>
|
||||
<listitem><para><literal>tun</literal></para></listitem>
|
||||
<listitem><para><literal>veth</literal></para></listitem>
|
||||
<listitem><para><literal>vlan</literal></para></listitem>
|
||||
|
|
|
|||
|
|
@ -121,7 +121,7 @@ _set_bond_attr(NMDevice *device, const char *attr, const char *value)
|
|||
/* kernel does not allow setting ad_actor_system to "00:00:00:00:00:00". We would thus
|
||||
* log an EINVAL error. Avoid that... at least, if the value is already "00:00:00:00:00:00". */
|
||||
cur_val =
|
||||
nm_platform_sysctl_master_get_option(nm_device_get_platform(device), ifindex, attr);
|
||||
nm_platform_sysctl_controller_get_option(nm_device_get_platform(device), ifindex, attr);
|
||||
if (nm_streq0(cur_val, NM_BOND_AD_ACTOR_SYSTEM_DEFAULT))
|
||||
return TRUE;
|
||||
|
||||
|
|
@ -129,8 +129,10 @@ _set_bond_attr(NMDevice *device, const char *attr, const char *value)
|
|||
* That will fail, and we will log a warning. There is nothing else to do. */
|
||||
}
|
||||
|
||||
ret =
|
||||
nm_platform_sysctl_master_set_option(nm_device_get_platform(device), ifindex, attr, value);
|
||||
ret = nm_platform_sysctl_controller_set_option(nm_device_get_platform(device),
|
||||
ifindex,
|
||||
attr,
|
||||
value);
|
||||
if (!ret)
|
||||
_LOGW(LOGD_PLATFORM, "failed to set bonding attribute '%s' to '%s'", attr, value);
|
||||
return ret;
|
||||
|
|
@ -187,8 +189,9 @@ update_connection(NMDevice *device, NMConnection *connection)
|
|||
NM_SETTING_BOND_OPTION_BALANCE_SLB))
|
||||
continue;
|
||||
|
||||
value =
|
||||
nm_platform_sysctl_master_get_option(nm_device_get_platform(device), ifindex, option);
|
||||
value = nm_platform_sysctl_controller_get_option(nm_device_get_platform(device),
|
||||
ifindex,
|
||||
option);
|
||||
|
||||
if (value && _nm_setting_bond_get_option_type(s_bond, option) == NM_BOND_OPTION_TYPE_BOTH) {
|
||||
p = strchr(value, ' ');
|
||||
|
|
@ -349,9 +352,10 @@ set_bond_arp_ip_targets(NMDevice *device, NMSettingBond *s_bond)
|
|||
gs_free char *cur_arp_ip_target = NULL;
|
||||
|
||||
/* ARP targets: clear and initialize the list */
|
||||
cur_arp_ip_target = nm_platform_sysctl_master_get_option(nm_device_get_platform(device),
|
||||
ifindex,
|
||||
NM_SETTING_BOND_OPTION_ARP_IP_TARGET);
|
||||
cur_arp_ip_target =
|
||||
nm_platform_sysctl_controller_get_option(nm_device_get_platform(device),
|
||||
ifindex,
|
||||
NM_SETTING_BOND_OPTION_ARP_IP_TARGET);
|
||||
set_arp_targets(
|
||||
device,
|
||||
cur_arp_ip_target,
|
||||
|
|
@ -699,7 +703,7 @@ attach_port(NMDevice *device,
|
|||
NMDeviceBond *self = NM_DEVICE_BOND(device);
|
||||
NMSettingBondPort *s_port;
|
||||
|
||||
nm_device_master_check_slave_physical_port(device, port, LOGD_BOND);
|
||||
nm_device_controller_check_slave_physical_port(device, port, LOGD_BOND);
|
||||
|
||||
if (configure) {
|
||||
gboolean success;
|
||||
|
|
@ -962,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->master_update_slave_connection = controller_update_port_connection;
|
||||
device_class->update_connection = update_connection;
|
||||
device_class->controller_update_slave_connection = controller_update_port_connection;
|
||||
|
||||
device_class->create_and_realize = create_and_realize;
|
||||
device_class->act_stage1_prepare = act_stage1_prepare;
|
||||
|
|
|
|||
|
|
@ -311,7 +311,7 @@ typedef struct {
|
|||
|
||||
#define OPTION_TYPE_TOFROM(to, fro) .to_sysfs = (to), .from_sysfs = (fro)
|
||||
|
||||
static const Option master_options[] = {
|
||||
static const Option controller_options[] = {
|
||||
OPTION(NM_SETTING_BRIDGE_STP, /* this must stay as the first item */
|
||||
"stp_state",
|
||||
OPTION_TYPE_BOOL(NM_BRIDGE_STP_DEF), ),
|
||||
|
|
@ -487,12 +487,12 @@ update_connection(NMDevice *device, NMConnection *connection)
|
|||
gs_free char *stp = NULL;
|
||||
int stp_value;
|
||||
|
||||
option = master_options;
|
||||
option = controller_options;
|
||||
nm_assert(nm_streq(option->sysname, "stp_state"));
|
||||
|
||||
stp = nm_platform_sysctl_master_get_option(nm_device_get_platform(device),
|
||||
ifindex,
|
||||
option->sysname);
|
||||
stp = nm_platform_sysctl_controller_get_option(nm_device_get_platform(device),
|
||||
ifindex,
|
||||
option->sysname);
|
||||
stp_value =
|
||||
_nm_utils_ascii_str_to_int64(stp, 10, option->nm_min, option->nm_max, option->nm_default);
|
||||
g_object_set(s_bridge, option->name, stp_value, NULL);
|
||||
|
|
@ -503,9 +503,9 @@ update_connection(NMDevice *device, NMConnection *connection)
|
|||
gs_free char *str = NULL;
|
||||
GParamSpec *pspec;
|
||||
|
||||
str = nm_platform_sysctl_master_get_option(nm_device_get_platform(device),
|
||||
ifindex,
|
||||
option->sysname);
|
||||
str = nm_platform_sysctl_controller_get_option(nm_device_get_platform(device),
|
||||
ifindex,
|
||||
option->sysname);
|
||||
pspec = g_object_class_find_property(G_OBJECT_GET_CLASS(s_bridge), option->name);
|
||||
|
||||
if (!stp_value && option->only_with_stp)
|
||||
|
|
@ -575,10 +575,10 @@ out:
|
|||
}
|
||||
|
||||
static gboolean
|
||||
master_update_slave_connection(NMDevice *device,
|
||||
NMDevice *slave,
|
||||
NMConnection *connection,
|
||||
GError **error)
|
||||
controller_update_slave_connection(NMDevice *device,
|
||||
NMDevice *slave,
|
||||
NMConnection *connection,
|
||||
GError **error)
|
||||
{
|
||||
NMSettingConnection *s_con;
|
||||
NMSettingBridgePort *s_port;
|
||||
|
|
@ -917,7 +917,7 @@ attach_port(NMDevice *device,
|
|||
gpointer user_data)
|
||||
{
|
||||
NMDeviceBridge *self = NM_DEVICE_BRIDGE(device);
|
||||
NMConnection *master_connection;
|
||||
NMConnection *controller_connection;
|
||||
NMSettingBridge *s_bridge;
|
||||
NMSettingBridgePort *s_port;
|
||||
|
||||
|
|
@ -927,9 +927,9 @@ attach_port(NMDevice *device,
|
|||
nm_device_get_ip_ifindex(port)))
|
||||
return FALSE;
|
||||
|
||||
master_connection = nm_device_get_applied_connection(device);
|
||||
nm_assert(master_connection);
|
||||
s_bridge = nm_connection_get_setting_bridge(master_connection);
|
||||
controller_connection = nm_device_get_applied_connection(device);
|
||||
nm_assert(controller_connection);
|
||||
s_bridge = nm_connection_get_setting_bridge(controller_connection);
|
||||
nm_assert(s_bridge);
|
||||
s_port = nm_connection_get_setting_bridge_port(connection);
|
||||
|
||||
|
|
@ -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->master_update_slave_connection = master_update_slave_connection;
|
||||
device_class->update_connection = update_connection;
|
||||
device_class->controller_update_slave_connection = controller_update_slave_connection;
|
||||
|
||||
device_class->create_and_realize = create_and_realize;
|
||||
device_class->act_stage1_prepare_set_hwaddr_ethernet = TRUE;
|
||||
|
|
|
|||
|
|
@ -58,10 +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_master_check_slave_physical_port(NMDevice *self, NMDevice *slave, NMLogDomain log_domain);
|
||||
void nm_device_controller_check_slave_physical_port(NMDevice *self,
|
||||
NMDevice *slave,
|
||||
NMLogDomain log_domain);
|
||||
|
||||
void nm_device_master_release_slaves_all(NMDevice *self);
|
||||
void nm_device_controller_release_slaves_all(NMDevice *self);
|
||||
|
||||
void nm_device_set_carrier(NMDevice *self, gboolean carrier);
|
||||
|
||||
|
|
|
|||
|
|
@ -222,7 +222,7 @@ attach_port(NMDevice *device,
|
|||
gboolean success = TRUE;
|
||||
const char *port_iface = nm_device_get_ip_iface(port);
|
||||
|
||||
nm_device_master_check_slave_physical_port(device, port, LOGD_DEVICE);
|
||||
nm_device_controller_check_slave_physical_port(device, port, LOGD_DEVICE);
|
||||
|
||||
if (configure) {
|
||||
nm_device_take_down(port, TRUE);
|
||||
|
|
|
|||
|
|
@ -789,7 +789,7 @@ 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_master_add_slave(NMDevice *self, NMDevice *slave, gboolean configure);
|
||||
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,
|
||||
|
|
@ -3836,7 +3836,7 @@ _dev_ip_state_check(NMDevice *self, int addr_family)
|
|||
&& nm_active_connection_get_controller(NM_ACTIVE_CONNECTION(priv->act_request.obj))
|
||||
&& !priv->is_enslaved) {
|
||||
/* Don't progress into IP_CHECK or SECONDARIES if we're waiting for the
|
||||
* master to enslave us. */
|
||||
* controller to enslave us. */
|
||||
ip_state = NM_DEVICE_IP_STATE_PENDING;
|
||||
goto got_ip_state;
|
||||
}
|
||||
|
|
@ -6733,8 +6733,8 @@ attach_port_cb(NMDevice *self, GError *error, gpointer user_data)
|
|||
}
|
||||
|
||||
/**
|
||||
* nm_device_master_enslave_slave:
|
||||
* @self: the master device
|
||||
* nm_device_controller_enslave_slave:
|
||||
* @self: the controller device
|
||||
* @slave: the slave device to enslave
|
||||
* @connection: (nullable): the slave device's connection
|
||||
*
|
||||
|
|
@ -6742,7 +6742,7 @@ attach_port_cb(NMDevice *self, GError *error, gpointer user_data)
|
|||
* etc) then this function enslaves @slave.
|
||||
*/
|
||||
static void
|
||||
nm_device_master_enslave_slave(NMDevice *self, NMDevice *slave, NMConnection *connection)
|
||||
nm_device_controller_enslave_slave(NMDevice *self, NMDevice *slave, NMConnection *connection)
|
||||
{
|
||||
SlaveInfo *info;
|
||||
NMTernary success;
|
||||
|
|
@ -6796,8 +6796,8 @@ detach_port_cb(NMDevice *self, GError *error, gpointer user_data)
|
|||
}
|
||||
|
||||
/**
|
||||
* nm_device_master_release_slave:
|
||||
* @self: the master device
|
||||
* nm_device_controller_release_slave:
|
||||
* @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
|
||||
|
|
@ -6809,10 +6809,10 @@ detach_port_cb(NMDevice *self, GError *error, gpointer user_data)
|
|||
* updates the state of @self and @slave to reflect its release.
|
||||
*/
|
||||
static void
|
||||
nm_device_master_release_slave(NMDevice *self,
|
||||
NMDevice *slave,
|
||||
ReleaseSlaveType release_type,
|
||||
NMDeviceStateReason reason)
|
||||
nm_device_controller_release_slave(NMDevice *self,
|
||||
NMDevice *slave,
|
||||
ReleaseSlaveType release_type,
|
||||
NMDeviceStateReason reason)
|
||||
{
|
||||
NMDevicePrivate *priv;
|
||||
NMDevicePrivate *port_priv;
|
||||
|
|
@ -6831,7 +6831,7 @@ nm_device_master_release_slave(NMDevice *self,
|
|||
info = find_slave_info(self, slave);
|
||||
|
||||
_LOGT(LOGD_CORE,
|
||||
"master: release one slave " NM_HASH_OBFUSCATE_PTR_FMT "/%s %s%s",
|
||||
"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)"),
|
||||
|
|
@ -7165,62 +7165,62 @@ static void
|
|||
device_recheck_slave_status(NMDevice *self, const NMPlatformLink *plink)
|
||||
{
|
||||
NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE(self);
|
||||
NMDevice *master;
|
||||
nm_auto_nmpobj const NMPObject *plink_master_keep_alive = NULL;
|
||||
const NMPlatformLink *plink_master;
|
||||
NMDevice *controller;
|
||||
nm_auto_nmpobj const NMPObject *plink_controller_keep_alive = NULL;
|
||||
const NMPlatformLink *plink_controller;
|
||||
|
||||
g_return_if_fail(plink);
|
||||
|
||||
if (plink->master > 0) {
|
||||
master = nm_manager_get_device_by_ifindex(NM_MANAGER_GET, plink->master);
|
||||
plink_master = nm_platform_link_get(nm_device_get_platform(self), plink->master);
|
||||
plink_master_keep_alive = nmp_object_ref(NMP_OBJECT_UP_CAST(plink_master));
|
||||
if (plink->controller > 0) {
|
||||
controller = nm_manager_get_device_by_ifindex(NM_MANAGER_GET, plink->controller);
|
||||
plink_controller = nm_platform_link_get(nm_device_get_platform(self), plink->controller);
|
||||
plink_controller_keep_alive = nmp_object_ref(NMP_OBJECT_UP_CAST(plink_controller));
|
||||
} else {
|
||||
if (priv->controller_ifindex == 0)
|
||||
goto out;
|
||||
master = NULL;
|
||||
plink_master = NULL;
|
||||
controller = NULL;
|
||||
plink_controller = NULL;
|
||||
}
|
||||
|
||||
if (master == NULL && plink_master
|
||||
&& NM_IN_STRSET(plink_master->name, "ovs-system", "ovs-netdev")
|
||||
&& plink_master->type == NM_LINK_TYPE_OPENVSWITCH) {
|
||||
if (controller == NULL && plink_controller
|
||||
&& NM_IN_STRSET(plink_controller->name, "ovs-system", "ovs-netdev")
|
||||
&& plink_controller->type == NM_LINK_TYPE_OPENVSWITCH) {
|
||||
_LOGD(LOGD_DEVICE, "the device claimed by openvswitch");
|
||||
goto out;
|
||||
}
|
||||
|
||||
priv->controller_ifindex = plink->master;
|
||||
priv->controller_ifindex = plink->controller;
|
||||
|
||||
if (priv->controller) {
|
||||
if (plink->master > 0 && plink->master == nm_device_get_ifindex(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
|
||||
* the master, but this also triggers a recheck-assume. */
|
||||
nm_device_master_add_slave(priv->controller, self, FALSE);
|
||||
* the controller, but this also triggers a recheck-assume. */
|
||||
nm_device_controller_add_slave(priv->controller, self, FALSE);
|
||||
goto out;
|
||||
}
|
||||
|
||||
nm_device_master_release_slave(priv->controller,
|
||||
self,
|
||||
RELEASE_SLAVE_TYPE_NO_CONFIG,
|
||||
NM_DEVICE_STATE_REASON_CONNECTION_ASSUMED);
|
||||
nm_device_controller_release_slave(priv->controller,
|
||||
self,
|
||||
RELEASE_SLAVE_TYPE_NO_CONFIG,
|
||||
NM_DEVICE_STATE_REASON_CONNECTION_ASSUMED);
|
||||
}
|
||||
|
||||
if (master) {
|
||||
if (NM_DEVICE_GET_CLASS(master)->attach_port) {
|
||||
nm_device_master_add_slave(master, self, FALSE);
|
||||
if (controller) {
|
||||
if (NM_DEVICE_GET_CLASS(controller)->attach_port) {
|
||||
nm_device_controller_add_slave(controller, self, FALSE);
|
||||
} else {
|
||||
_LOGD(LOGD_DEVICE,
|
||||
"enslaved to non-master-type device %s; ignoring",
|
||||
nm_device_get_iface(master));
|
||||
"enslaved to non-controller-type device %s; ignoring",
|
||||
nm_device_get_iface(controller));
|
||||
}
|
||||
goto out;
|
||||
}
|
||||
|
||||
if (plink->master) {
|
||||
if (plink->controller) {
|
||||
_LOGD(LOGD_DEVICE,
|
||||
"enslaved to unknown device %d (%s%s%s)",
|
||||
plink->master,
|
||||
NM_PRINT_FMT_QUOTED(plink_master, "\"", plink_master->name, "\"", "??"));
|
||||
plink->controller,
|
||||
NM_PRINT_FMT_QUOTED(plink_controller, "\"", plink_controller->name, "\"", "??"));
|
||||
if (!priv->ifindex_changed_id) {
|
||||
priv->ifindex_changed_id = g_signal_connect(nm_device_get_manager(self),
|
||||
NM_MANAGER_DEVICE_IFINDEX_CHANGED,
|
||||
|
|
@ -7246,7 +7246,7 @@ device_ifindex_changed_cb(NMManager *manager, NMDevice *device_changed, NMDevice
|
|||
return;
|
||||
|
||||
_LOGD(LOGD_DEVICE,
|
||||
"master %s with ifindex %d appeared",
|
||||
"controller %s with ifindex %d appeared",
|
||||
nm_device_get_iface(device_changed),
|
||||
nm_device_get_ifindex(device_changed));
|
||||
if (!priv->device_link_changed_id)
|
||||
|
|
@ -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 master/slave or parent/child
|
||||
* any tasks that affect other interfaces (like controller/slave 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 master/slave or parent/child relationships from
|
||||
* Update the device's controller/slave or parent/child relationships from
|
||||
* backing resource properties. After this function finishes, the device
|
||||
* is ready for network connectivity.
|
||||
*/
|
||||
|
|
@ -8454,12 +8454,12 @@ slave_state_changed(NMDevice *slave,
|
|||
slave_new_state,
|
||||
nm_device_state_to_string(slave_new_state));
|
||||
|
||||
/* Don't try to enslave slaves until the master is ready */
|
||||
/* Don't try to enslave slaves until the controller is ready */
|
||||
if (priv->state < NM_DEVICE_STATE_CONFIG)
|
||||
return;
|
||||
|
||||
if (slave_new_state == NM_DEVICE_STATE_IP_CONFIG)
|
||||
nm_device_master_enslave_slave(self, slave, nm_device_get_applied_connection(slave));
|
||||
nm_device_controller_enslave_slave(self, slave, nm_device_get_applied_connection(slave));
|
||||
else if (slave_new_state > NM_DEVICE_STATE_ACTIVATED)
|
||||
release = TRUE;
|
||||
else if (slave_new_state <= NM_DEVICE_STATE_DISCONNECTED
|
||||
|
|
@ -8473,11 +8473,11 @@ slave_state_changed(NMDevice *slave,
|
|||
&& 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_master_release_slave(self,
|
||||
slave,
|
||||
configure ? RELEASE_SLAVE_TYPE_CONFIG
|
||||
: RELEASE_SLAVE_TYPE_NO_CONFIG,
|
||||
reason);
|
||||
nm_device_controller_release_slave(self,
|
||||
slave,
|
||||
configure ? RELEASE_SLAVE_TYPE_CONFIG
|
||||
: RELEASE_SLAVE_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");
|
||||
|
|
@ -8485,10 +8485,10 @@ slave_state_changed(NMDevice *slave,
|
|||
}
|
||||
|
||||
/**
|
||||
* nm_device_master_add_slave:
|
||||
* @self: the master device
|
||||
* nm_device_controller_add_slave:
|
||||
* @self: the controller device
|
||||
* @slave: the slave device to enslave
|
||||
* @configure: pass %TRUE if the slave should be configured by the master, or
|
||||
* @configure: pass %TRUE if the slave 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,
|
||||
|
|
@ -8498,7 +8498,7 @@ slave_state_changed(NMDevice *slave,
|
|||
* enslaved and nothing was done.
|
||||
*/
|
||||
static gboolean
|
||||
nm_device_master_add_slave(NMDevice *self, NMDevice *slave, gboolean configure)
|
||||
nm_device_controller_add_slave(NMDevice *self, NMDevice *slave, gboolean configure)
|
||||
{
|
||||
NMDevicePrivate *priv;
|
||||
NMDevicePrivate *port_priv;
|
||||
|
|
@ -8515,7 +8515,7 @@ nm_device_master_add_slave(NMDevice *self, NMDevice *slave, gboolean configure)
|
|||
info = find_slave_info(self, slave);
|
||||
|
||||
_LOGT(LOGD_CORE,
|
||||
"master: add one slave " NM_HASH_OBFUSCATE_PTR_FMT "/%s%s",
|
||||
"controller: add one slave " NM_HASH_OBFUSCATE_PTR_FMT "/%s%s",
|
||||
NM_HASH_OBFUSCATE_PTR(slave),
|
||||
nm_device_get_iface(slave),
|
||||
info ? " (already registered)" : "");
|
||||
|
|
@ -8560,8 +8560,8 @@ nm_device_master_add_slave(NMDevice *self, NMDevice *slave, gboolean configure)
|
|||
}
|
||||
|
||||
/**
|
||||
* nm_device_master_check_slave_physical_port:
|
||||
* @self: the master device
|
||||
* nm_device_controller_check_slave_physical_port:
|
||||
* @self: the controller device
|
||||
* @slave: a slave device
|
||||
* @log_domain: domain to log a warning in
|
||||
*
|
||||
|
|
@ -8569,7 +8569,9 @@ nm_device_master_add_slave(NMDevice *self, NMDevice *slave, gboolean configure)
|
|||
* as @slave, and logs a warning if so.
|
||||
*/
|
||||
void
|
||||
nm_device_master_check_slave_physical_port(NMDevice *self, NMDevice *slave, NMLogDomain log_domain)
|
||||
nm_device_controller_check_slave_physical_port(NMDevice *self,
|
||||
NMDevice *slave,
|
||||
NMLogDomain log_domain)
|
||||
{
|
||||
NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE(self);
|
||||
const char *slave_physical_port_id, *existing_physical_port_id;
|
||||
|
|
@ -8600,7 +8602,7 @@ nm_device_master_check_slave_physical_port(NMDevice *self, NMDevice *slave, NMLo
|
|||
}
|
||||
|
||||
void
|
||||
nm_device_master_release_slaves_all(NMDevice *self)
|
||||
nm_device_controller_release_slaves_all(NMDevice *self)
|
||||
{
|
||||
NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE(self);
|
||||
NMDeviceStateReason reason;
|
||||
|
|
@ -8619,11 +8621,11 @@ nm_device_master_release_slaves_all(NMDevice *self)
|
|||
if (priv->activation_state_preserve_external_ports
|
||||
&& nm_device_sys_iface_state_is_external(info->slave)) {
|
||||
_LOGT(LOGD_DEVICE,
|
||||
"master: preserve external port %s",
|
||||
"controller: preserve external port %s",
|
||||
nm_device_get_iface(info->slave));
|
||||
continue;
|
||||
}
|
||||
nm_device_master_release_slave(self, info->slave, RELEASE_SLAVE_TYPE_CONFIG, reason);
|
||||
nm_device_controller_release_slave(self, info->slave, RELEASE_SLAVE_TYPE_CONFIG, reason);
|
||||
}
|
||||
|
||||
/* We only need this flag for a short time. It served its purpose. Clear
|
||||
|
|
@ -8675,7 +8677,7 @@ nm_device_get_controller(NMDevice *self)
|
|||
* @self: the slave device
|
||||
* @success: whether the enslaving operation succeeded
|
||||
*
|
||||
* Notifies a slave that either it has been enslaved, or else its master tried
|
||||
* Notifies a slave that either it has been enslaved, or else its controller tried
|
||||
* to enslave it and failed.
|
||||
*/
|
||||
static void
|
||||
|
|
@ -8737,7 +8739,7 @@ nm_device_slave_notify_release(NMDevice *self,
|
|||
{
|
||||
NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE(self);
|
||||
NMConnection *connection = nm_device_get_applied_connection(self);
|
||||
const char *master_status;
|
||||
const char *controller_status;
|
||||
|
||||
g_return_if_fail(priv->controller);
|
||||
|
||||
|
|
@ -8747,31 +8749,33 @@ nm_device_slave_notify_release(NMDevice *self,
|
|||
if (priv->state > NM_DEVICE_STATE_DISCONNECTED && priv->state <= NM_DEVICE_STATE_ACTIVATED) {
|
||||
switch (nm_device_state_reason_check(reason)) {
|
||||
case NM_DEVICE_STATE_REASON_DEPENDENCY_FAILED:
|
||||
master_status = "failed";
|
||||
controller_status = "failed";
|
||||
break;
|
||||
case NM_DEVICE_STATE_REASON_USER_REQUESTED:
|
||||
reason = NM_DEVICE_STATE_REASON_USER_REQUESTED;
|
||||
master_status = "deactivated by user request";
|
||||
reason = NM_DEVICE_STATE_REASON_USER_REQUESTED;
|
||||
controller_status = "deactivated by user request";
|
||||
break;
|
||||
case NM_DEVICE_STATE_REASON_CONNECTION_REMOVED:
|
||||
reason = NM_DEVICE_STATE_REASON_DEPENDENCY_FAILED;
|
||||
master_status = "deactivated because master was removed";
|
||||
reason = NM_DEVICE_STATE_REASON_DEPENDENCY_FAILED;
|
||||
controller_status = "deactivated because controller was removed";
|
||||
break;
|
||||
default:
|
||||
master_status = "deactivated";
|
||||
controller_status = "deactivated";
|
||||
break;
|
||||
}
|
||||
|
||||
_LOGD(LOGD_DEVICE,
|
||||
"Activation: connection '%s' master %s",
|
||||
"Activation: connection '%s' controller %s",
|
||||
nm_connection_get_id(connection),
|
||||
master_status);
|
||||
controller_status);
|
||||
|
||||
/* Cancel any pending activation sources */
|
||||
_cancel_activation(self);
|
||||
nm_device_queue_state(self, NM_DEVICE_STATE_DEACTIVATING, reason);
|
||||
} else
|
||||
_LOGI(LOGD_DEVICE, "released from master device %s", nm_device_get_iface(priv->controller));
|
||||
_LOGI(LOGD_DEVICE,
|
||||
"released from controller device %s",
|
||||
nm_device_get_iface(priv->controller));
|
||||
|
||||
priv->is_enslaved = FALSE;
|
||||
|
||||
|
|
@ -8788,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 master in case it's enslaved.
|
||||
* the controller in case it's enslaved.
|
||||
*/
|
||||
void
|
||||
nm_device_removed(NMDevice *self, gboolean unconfigure_ip_config)
|
||||
|
|
@ -8804,11 +8808,11 @@ 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 master, but don't touch the device. */
|
||||
nm_device_master_release_slave(priv->controller,
|
||||
self,
|
||||
RELEASE_SLAVE_TYPE_NO_CONFIG,
|
||||
NM_DEVICE_STATE_REASON_CONNECTION_ASSUMED);
|
||||
* 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);
|
||||
}
|
||||
|
||||
_dev_l3_register_l3cds(self, priv->l3cfg, FALSE, unconfigure_ip_config);
|
||||
|
|
@ -8837,7 +8841,7 @@ is_available(NMDevice *self, NMDeviceCheckDevAvailableFlags flags)
|
|||
if (NM_FLAGS_HAS(flags, _NM_DEVICE_CHECK_DEV_AVAILABLE_IGNORE_CARRIER))
|
||||
return TRUE;
|
||||
|
||||
/* master types are always available even without carrier. */
|
||||
/* controller types are always available even without carrier. */
|
||||
if (nm_device_is_controller(self))
|
||||
return TRUE;
|
||||
|
||||
|
|
@ -8877,7 +8881,7 @@ nm_device_is_available(NMDevice *self, NMDeviceCheckDevAvailableFlags flags)
|
|||
gboolean
|
||||
nm_device_ignore_carrier_by_default(NMDevice *self)
|
||||
{
|
||||
/* master types ignore-carrier by default. */
|
||||
/* controller types ignore-carrier by default. */
|
||||
return nm_device_is_controller(self);
|
||||
}
|
||||
|
||||
|
|
@ -9090,7 +9094,7 @@ device_has_config(NMDevice *self)
|
|||
if (!pllink)
|
||||
return FALSE;
|
||||
|
||||
if (pllink->master > 0) {
|
||||
if (pllink->controller > 0) {
|
||||
/* Master-slave relationship is also a configuration */
|
||||
return TRUE;
|
||||
}
|
||||
|
|
@ -9116,23 +9120,23 @@ device_has_config(NMDevice *self)
|
|||
}
|
||||
|
||||
/**
|
||||
* nm_device_master_update_slave_connection:
|
||||
* @self: the master #NMDevice
|
||||
* nm_device_controller_update_slave_connection:
|
||||
* @self: the controller #NMDevice
|
||||
* @slave: the slave #NMDevice
|
||||
* @connection: the #NMConnection to update with the slave settings
|
||||
* @error: error description
|
||||
*
|
||||
* Reads the slave configuration for @slave and updates @connection with those
|
||||
* properties. This invokes a virtual function on the master device @self.
|
||||
* 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_master_update_slave_connection(NMDevice *self,
|
||||
NMDevice *slave,
|
||||
NMConnection *connection,
|
||||
GError **error)
|
||||
nm_device_controller_update_slave_connection(NMDevice *self,
|
||||
NMDevice *slave,
|
||||
NMConnection *connection,
|
||||
GError **error)
|
||||
{
|
||||
NMDeviceClass *klass;
|
||||
gboolean success;
|
||||
|
|
@ -9147,20 +9151,21 @@ nm_device_master_update_slave_connection(NMDevice *self,
|
|||
g_return_val_if_fail(nm_device_get_iface(self), FALSE);
|
||||
|
||||
klass = NM_DEVICE_GET_CLASS(self);
|
||||
if (klass->master_update_slave_connection) {
|
||||
success = klass->master_update_slave_connection(self, slave, connection, error);
|
||||
if (klass->controller_update_slave_connection) {
|
||||
success = klass->controller_update_slave_connection(self, slave, connection, error);
|
||||
|
||||
g_return_val_if_fail(!error || (success && !*error) || *error, success);
|
||||
return success;
|
||||
}
|
||||
|
||||
g_set_error(error,
|
||||
NM_DEVICE_ERROR,
|
||||
NM_DEVICE_ERROR_FAILED,
|
||||
"master device '%s' cannot update a slave connection for slave device '%s' (master "
|
||||
"type not supported?)",
|
||||
nm_device_get_iface(self),
|
||||
nm_device_get_iface(slave));
|
||||
g_set_error(
|
||||
error,
|
||||
NM_DEVICE_ERROR,
|
||||
NM_DEVICE_ERROR_FAILED,
|
||||
"controller device '%s' cannot update a slave connection for slave device '%s' (controller "
|
||||
"type not supported?)",
|
||||
nm_device_get_iface(self),
|
||||
nm_device_get_iface(slave));
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
|
@ -9196,7 +9201,7 @@ _get_maybe_ipv6_disabled(NMDevice *self)
|
|||
*/
|
||||
NMConnection *
|
||||
nm_device_generate_connection(NMDevice *self,
|
||||
NMDevice *master,
|
||||
NMDevice *controller,
|
||||
gboolean *out_maybe_later,
|
||||
GError **error)
|
||||
{
|
||||
|
|
@ -9255,20 +9260,20 @@ nm_device_generate_connection(NMDevice *self,
|
|||
nm_connection_add_setting(connection, s_con);
|
||||
|
||||
/* If the device is a slave, update various slave settings */
|
||||
if (master) {
|
||||
if (!nm_device_master_update_slave_connection(master, self, connection, &local)) {
|
||||
if (controller) {
|
||||
if (!nm_device_controller_update_slave_connection(controller, self, connection, &local)) {
|
||||
g_set_error(error,
|
||||
NM_DEVICE_ERROR,
|
||||
NM_DEVICE_ERROR_FAILED,
|
||||
"master device '%s' failed to update slave connection: %s",
|
||||
nm_device_get_iface(master),
|
||||
"controller device '%s' failed to update slave connection: %s",
|
||||
nm_device_get_iface(controller),
|
||||
local->message);
|
||||
g_error_free(local);
|
||||
NM_SET_OUT(out_maybe_later, TRUE);
|
||||
return NULL;
|
||||
}
|
||||
} else {
|
||||
/* Only regular and master devices get IP configuration; slaves do not */
|
||||
/* Only regular and controller devices get IP configuration; slaves do not */
|
||||
s_ip4 = nm_utils_platform_capture_ip_setting(nm_device_get_platform(self),
|
||||
AF_INET,
|
||||
nm_device_get_ip_ifindex(self),
|
||||
|
|
@ -9309,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 master interface.
|
||||
* no slave 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);
|
||||
|
|
@ -9324,11 +9329,11 @@ nm_device_generate_connection(NMDevice *self,
|
|||
error,
|
||||
NM_DEVICE_ERROR,
|
||||
NM_DEVICE_ERROR_FAILED,
|
||||
"ignoring generated connection (no IP and not in master-slave relationship)");
|
||||
"ignoring generated connection (no IP and not in controller-slave relationship)");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* Ignore any IPv6LL-only, not master connections without slaves,
|
||||
/* Ignore any IPv6LL-only, not controller connections without slaves,
|
||||
* unless they are in the assume-ipv6ll-only list.
|
||||
*/
|
||||
if (nm_streq0(ip4_method, NM_SETTING_IP4_CONFIG_METHOD_DISABLED)
|
||||
|
|
@ -9336,14 +9341,15 @@ nm_device_generate_connection(NMDevice *self,
|
|||
&& !nm_setting_connection_get_controller(NM_SETTING_CONNECTION(s_con))
|
||||
&& c_list_is_empty(&priv->slaves)
|
||||
&& !nm_config_data_get_assume_ipv6ll_only(NM_CONFIG_GET_DATA, self)) {
|
||||
_LOGD(LOGD_DEVICE,
|
||||
"ignoring generated connection (IPv6LL-only and not in master-slave relationship)");
|
||||
_LOGD(
|
||||
LOGD_DEVICE,
|
||||
"ignoring generated connection (IPv6LL-only and not in controller-slave 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 master-slave relationship)");
|
||||
"ignoring generated connection (IPv6LL-only and not in controller-slave relationship)");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
|
@ -9605,7 +9611,7 @@ nm_device_check_slave_connection_compatible(NMDevice *self, NMConnection *slave)
|
|||
if (!nm_device_is_controller(self))
|
||||
return FALSE;
|
||||
|
||||
/* All masters should have connection type set */
|
||||
/* All controllers should have connection type set */
|
||||
connection_type = NM_DEVICE_GET_CLASS(self)->connection_type_supported;
|
||||
g_return_val_if_fail(connection_type, FALSE);
|
||||
|
||||
|
|
@ -9905,35 +9911,37 @@ activation_source_invoke_or_schedule(NMDevice *self, ActivationHandleFunc func,
|
|||
/*****************************************************************************/
|
||||
|
||||
static void
|
||||
master_ready(NMDevice *self, NMActiveConnection *active)
|
||||
controller_ready(NMDevice *self, NMActiveConnection *active)
|
||||
{
|
||||
NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE(self);
|
||||
NMActiveConnection *master_connection;
|
||||
NMDevice *master;
|
||||
NMActiveConnection *controller_connection;
|
||||
NMDevice *controller;
|
||||
|
||||
/* Notify a controller device that it has a new port */
|
||||
nm_assert(nm_active_connection_get_controller_ready(active));
|
||||
|
||||
master_connection = nm_active_connection_get_controller(active);
|
||||
controller_connection = nm_active_connection_get_controller(active);
|
||||
|
||||
master = nm_active_connection_get_device(master_connection);
|
||||
controller = nm_active_connection_get_device(controller_connection);
|
||||
|
||||
_LOGD(LOGD_DEVICE, "master connection ready; master device %s", nm_device_get_iface(master));
|
||||
_LOGD(LOGD_DEVICE,
|
||||
"controller connection ready; controller device %s",
|
||||
nm_device_get_iface(controller));
|
||||
|
||||
if (priv->controller && priv->controller != master)
|
||||
nm_device_master_release_slave(priv->controller,
|
||||
self,
|
||||
RELEASE_SLAVE_TYPE_NO_CONFIG,
|
||||
NM_DEVICE_STATE_REASON_CONNECTION_ASSUMED);
|
||||
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);
|
||||
|
||||
/* If the master didn't change, add-slave only rechecks whether to assume a connection. */
|
||||
nm_device_master_add_slave(master,
|
||||
self,
|
||||
!nm_device_sys_iface_state_is_external_or_assume(self));
|
||||
/* 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));
|
||||
}
|
||||
|
||||
static void
|
||||
master_ready_cb(NMActiveConnection *active, GParamSpec *pspec, NMDevice *self)
|
||||
controller_ready_cb(NMActiveConnection *active, GParamSpec *pspec, NMDevice *self)
|
||||
{
|
||||
NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE(self);
|
||||
|
||||
|
|
@ -10062,7 +10070,7 @@ activate_stage1_device_prepare(NMDevice *self)
|
|||
NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE(self);
|
||||
NMActStageReturn ret = NM_ACT_STAGE_RETURN_SUCCESS;
|
||||
NMActiveConnection *active;
|
||||
NMActiveConnection *master;
|
||||
NMActiveConnection *controller;
|
||||
NMDeviceClass *klass;
|
||||
|
||||
nm_assert((priv->ip_data_4.state == NM_DEVICE_IP_STATE_NONE)
|
||||
|
|
@ -10183,16 +10191,16 @@ activate_stage1_device_prepare(NMDevice *self)
|
|||
}
|
||||
}
|
||||
|
||||
active = NM_ACTIVE_CONNECTION(priv->act_request.obj);
|
||||
master = nm_active_connection_get_controller(active);
|
||||
if (master) {
|
||||
if (nm_active_connection_get_state(master) >= NM_ACTIVE_CONNECTION_STATE_DEACTIVATING) {
|
||||
NMDevice *master_device = nm_active_connection_get_device(master);
|
||||
NMDeviceStateReason failure_reason = NM_DEVICE_STATE_REASON_DEPENDENCY_FAILED;
|
||||
active = NM_ACTIVE_CONNECTION(priv->act_request.obj);
|
||||
controller = nm_active_connection_get_controller(active);
|
||||
if (controller) {
|
||||
if (nm_active_connection_get_state(controller) >= NM_ACTIVE_CONNECTION_STATE_DEACTIVATING) {
|
||||
NMDevice *controller_device = nm_active_connection_get_device(controller);
|
||||
NMDeviceStateReason failure_reason = NM_DEVICE_STATE_REASON_DEPENDENCY_FAILED;
|
||||
|
||||
_LOGD(LOGD_DEVICE, "master connection is deactivating");
|
||||
_LOGD(LOGD_DEVICE, "controller connection is deactivating");
|
||||
|
||||
if (master_device && NM_DEVICE_GET_PRIVATE(master_device)->queued_act_request) {
|
||||
if (controller_device && NM_DEVICE_GET_PRIVATE(controller_device)->queued_act_request) {
|
||||
/* if the controller is going to activate again, don't block this device */
|
||||
failure_reason = NM_DEVICE_STATE_REASON_NONE;
|
||||
}
|
||||
|
|
@ -10206,20 +10214,20 @@ activate_stage1_device_prepare(NMDevice *self)
|
|||
priv->controller_ready_id =
|
||||
g_signal_connect(active,
|
||||
"notify::" NM_ACTIVE_CONNECTION_INT_CONTROLLER_READY,
|
||||
G_CALLBACK(master_ready_cb),
|
||||
G_CALLBACK(controller_ready_cb),
|
||||
self);
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
nm_clear_g_signal_handler(priv->act_request.obj, &priv->controller_ready_id);
|
||||
if (master)
|
||||
master_ready(self, active);
|
||||
if (controller)
|
||||
controller_ready(self, active);
|
||||
else if (priv->controller) {
|
||||
nm_device_master_release_slave(priv->controller,
|
||||
self,
|
||||
RELEASE_SLAVE_TYPE_CONFIG_FORCE,
|
||||
NM_DEVICE_STATE_REASON_CONNECTION_ASSUMED);
|
||||
nm_device_controller_release_slave(priv->controller,
|
||||
self,
|
||||
RELEASE_SLAVE_TYPE_CONFIG_FORCE,
|
||||
NM_DEVICE_STATE_REASON_CONNECTION_ASSUMED);
|
||||
}
|
||||
|
||||
nm_device_activate_schedule_stage2_device_config(self, TRUE);
|
||||
|
|
@ -10500,9 +10508,9 @@ activate_stage2_device_config(NMDevice *self)
|
|||
NMDeviceState slave_state = nm_device_get_state(info->slave);
|
||||
|
||||
if (slave_state == NM_DEVICE_STATE_IP_CONFIG)
|
||||
nm_device_master_enslave_slave(self,
|
||||
info->slave,
|
||||
nm_device_get_applied_connection(info->slave));
|
||||
nm_device_controller_enslave_slave(self,
|
||||
info->slave,
|
||||
nm_device_get_applied_connection(info->slave));
|
||||
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);
|
||||
|
|
@ -11924,10 +11932,10 @@ _set_mtu(NMDevice *self, guint32 mtu)
|
|||
_notify(self, PROP_MTU);
|
||||
|
||||
if (priv->controller) {
|
||||
/* changing the MTU of a slave, might require the master to reset
|
||||
* its MTU. Note that the master usually cannot set a MTU larger
|
||||
/* changing the MTU of a slave, 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,
|
||||
* master might want to retry setting the MTU. */
|
||||
* controller might want to retry setting the MTU. */
|
||||
nm_device_commit_mtu(priv->controller);
|
||||
}
|
||||
}
|
||||
|
|
@ -12717,7 +12725,7 @@ activate_stage3_ip_config_for_addr_family(NMDevice *self, int addr_family, const
|
|||
}
|
||||
|
||||
if (nm_device_is_controller(self) && ip_requires_slaves(self, addr_family)) {
|
||||
/* If the master has no ready slaves, and depends on slaves for
|
||||
/* If the controller has no ready slaves, and depends on slaves for
|
||||
* a successful IP configuration attempt, then postpone IP addressing.
|
||||
*/
|
||||
if (!have_any_ready_slaves(self)) {
|
||||
|
|
@ -14289,7 +14297,7 @@ _device_activate(NMDevice *self, NMActRequest *req)
|
|||
g_return_if_fail(NM_IS_ACT_REQUEST(req));
|
||||
nm_assert(nm_device_is_real(self));
|
||||
|
||||
/* Ensure the activation request is still valid; the master may have
|
||||
/* Ensure the activation request is still valid; the controller may have
|
||||
* already failed in which case activation of this device should not proceed.
|
||||
*/
|
||||
if (nm_active_connection_get_state(NM_ACTIVE_CONNECTION(req))
|
||||
|
|
@ -15991,7 +15999,7 @@ check_connection_available(NMDevice *self,
|
|||
}
|
||||
|
||||
if (nm_device_is_controller(self)) {
|
||||
/* master types are always available even without carrier.
|
||||
/* controller types are always available even without carrier.
|
||||
* Making connection non-available would un-enslave slaves which
|
||||
* is not desired. */
|
||||
return TRUE;
|
||||
|
|
@ -16446,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) {
|
||||
/* master: release slaves */
|
||||
nm_device_master_release_slaves_all(self);
|
||||
/* controller: release slaves */
|
||||
nm_device_controller_release_slaves_all(self);
|
||||
|
||||
/* Take out any entries in the routing table and any IP address the device had. */
|
||||
if (ifindex > 0) {
|
||||
|
|
@ -16471,11 +16479,11 @@ nm_device_cleanup(NMDevice *self, NMDeviceStateReason reason, CleanupType cleanu
|
|||
|
||||
/* slave: mark no longer enslaved */
|
||||
if (priv->controller && priv->ifindex > 0
|
||||
&& nm_platform_link_get_master(nm_device_get_platform(self), priv->ifindex) <= 0) {
|
||||
nm_device_master_release_slave(priv->controller,
|
||||
self,
|
||||
RELEASE_SLAVE_TYPE_NO_CONFIG,
|
||||
NM_DEVICE_STATE_REASON_CONNECTION_ASSUMED);
|
||||
&& 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);
|
||||
}
|
||||
|
||||
lldp_setup(self, NM_TERNARY_FALSE);
|
||||
|
|
@ -16768,7 +16776,7 @@ _set_state_full(NMDevice *self, NMDeviceState state, NMDeviceStateReason reason,
|
|||
|
||||
if (state < NM_DEVICE_STATE_UNAVAILABLE
|
||||
|| (state >= NM_DEVICE_STATE_IP_CONFIG && state < NM_DEVICE_STATE_ACTIVATED)) {
|
||||
/* preserve-external-ports is used by NMCheckpoint to activate a master
|
||||
/* preserve-external-ports is used by NMCheckpoint to activate a controller
|
||||
* device, and preserve already attached ports. This means, this state is only
|
||||
* relevant during the deactivation and the following activation of the
|
||||
* right profile. Once we are sufficiently far in the activation of the
|
||||
|
|
@ -16985,7 +16993,7 @@ _set_state_full(NMDevice *self, NMDeviceState state, NMDeviceStateReason reason,
|
|||
case NM_DEVICE_STATE_FAILED:
|
||||
/* Usually upon failure the activation chain is interrupted in
|
||||
* one of the stages; but in some cases the device fails for
|
||||
* external events (as a failure of master connection) while
|
||||
* external events (as a failure of controller connection) while
|
||||
* the activation sequence is running and so we need to ensure
|
||||
* that the chain is terminated here.
|
||||
*/
|
||||
|
|
@ -16997,7 +17005,7 @@ _set_state_full(NMDevice *self, NMDeviceState state, NMDeviceStateReason reason,
|
|||
sett_conn ? nm_settings_connection_get_id(sett_conn) : "<unknown>");
|
||||
|
||||
/* Notify any slaves of the unexpected failure */
|
||||
nm_device_master_release_slaves_all(self);
|
||||
nm_device_controller_release_slaves_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
|
||||
|
|
@ -17221,7 +17229,7 @@ nm_device_get_state_reason(NMDevice *self)
|
|||
* @flag: whether to set or clear the the flag.
|
||||
*
|
||||
* This sets an internal flag to true, which does something specific.
|
||||
* For non-master devices, it has no effect. For master devices, this
|
||||
* For non-controller devices, it has no effect. For controller devices, this
|
||||
* will prevent to detach all external ports, until the next activation
|
||||
* completes.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -375,10 +375,10 @@ typedef struct _NMDeviceClass {
|
|||
/* Update the connection with currently configured L2 settings */
|
||||
void (*update_connection)(NMDevice *device, NMConnection *connection);
|
||||
|
||||
gboolean (*master_update_slave_connection)(NMDevice *self,
|
||||
NMDevice *slave,
|
||||
NMConnection *connection,
|
||||
GError **error);
|
||||
gboolean (*controller_update_slave_connection)(NMDevice *self,
|
||||
NMDevice *slave,
|
||||
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
|
||||
|
|
@ -526,14 +526,14 @@ gboolean nm_device_is_available(NMDevice *dev, NMDeviceCheckDevAvailableFlags fl
|
|||
gboolean nm_device_has_carrier(NMDevice *dev);
|
||||
|
||||
NMConnection *nm_device_generate_connection(NMDevice *self,
|
||||
NMDevice *master,
|
||||
NMDevice *controller,
|
||||
gboolean *out_maybe_later,
|
||||
GError **error);
|
||||
|
||||
gboolean nm_device_master_update_slave_connection(NMDevice *master,
|
||||
NMDevice *slave,
|
||||
NMConnection *connection,
|
||||
GError **error);
|
||||
gboolean nm_device_controller_update_slave_connection(NMDevice *controller,
|
||||
NMDevice *slave,
|
||||
NMConnection *connection,
|
||||
GError **error);
|
||||
|
||||
gboolean
|
||||
nm_device_can_auto_connect(NMDevice *self, NMSettingsConnection *sett_conn, char **specific_object);
|
||||
|
|
|
|||
|
|
@ -238,10 +238,10 @@ update_connection(NMDevice *device, NMConnection *connection)
|
|||
/*****************************************************************************/
|
||||
|
||||
static gboolean
|
||||
master_update_slave_connection(NMDevice *device,
|
||||
NMDevice *slave,
|
||||
NMConnection *connection,
|
||||
GError **error)
|
||||
controller_update_slave_connection(NMDevice *device,
|
||||
NMDevice *slave,
|
||||
NMConnection *connection,
|
||||
GError **error)
|
||||
{
|
||||
NMDeviceTeam *self = NM_DEVICE_TEAM(device);
|
||||
NMSettingTeamPort *s_port;
|
||||
|
|
@ -256,14 +256,15 @@ master_update_slave_connection(NMDevice *device,
|
|||
|
||||
tdc = _tdc_connect_new(self, iface, &connect_error);
|
||||
if (!tdc) {
|
||||
g_set_error(error,
|
||||
NM_DEVICE_ERROR,
|
||||
NM_DEVICE_ERROR_FAILED,
|
||||
"update slave connection for slave '%s' failed to connect to teamd for master "
|
||||
"%s (%s)",
|
||||
iface_slave,
|
||||
iface,
|
||||
connect_error->message);
|
||||
g_set_error(
|
||||
error,
|
||||
NM_DEVICE_ERROR,
|
||||
NM_DEVICE_ERROR_FAILED,
|
||||
"update slave connection for slave '%s' failed to connect to teamd for controller "
|
||||
"%s (%s)",
|
||||
iface_slave,
|
||||
iface,
|
||||
connect_error->message);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
|
@ -276,7 +277,7 @@ master_update_slave_connection(NMDevice *device,
|
|||
NM_DEVICE_ERROR,
|
||||
NM_DEVICE_ERROR_FAILED,
|
||||
"update slave connection for slave '%s' failed to get configuration from teamd "
|
||||
"master %s (err=%d)",
|
||||
"controller %s (err=%d)",
|
||||
iface_slave,
|
||||
iface,
|
||||
err);
|
||||
|
|
@ -858,7 +859,7 @@ attach_port(NMDevice *device,
|
|||
const char *port_iface = nm_device_get_ip_iface(port);
|
||||
NMSettingTeamPort *s_team_port;
|
||||
|
||||
nm_device_master_check_slave_physical_port(device, port, LOGD_TEAM);
|
||||
nm_device_controller_check_slave_physical_port(device, port, LOGD_TEAM);
|
||||
|
||||
if (configure) {
|
||||
nm_device_take_down(port, TRUE);
|
||||
|
|
@ -974,7 +975,7 @@ create_and_realize(NMDevice *device,
|
|||
g_set_error(error,
|
||||
NM_DEVICE_ERROR,
|
||||
NM_DEVICE_ERROR_CREATION_FAILED,
|
||||
"Failed to create team master interface '%s' for '%s': %s",
|
||||
"Failed to create team controller interface '%s' for '%s': %s",
|
||||
iface,
|
||||
nm_connection_get_id(connection),
|
||||
nm_strerror(r));
|
||||
|
|
@ -1127,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->master_update_slave_connection = master_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_slave_connection = controller_update_slave_connection;
|
||||
|
||||
device_class->act_stage1_prepare_also_for_external_or_assume = TRUE;
|
||||
device_class->act_stage1_prepare = act_stage1_prepare;
|
||||
|
|
|
|||
|
|
@ -3293,8 +3293,8 @@ act_stage2_config(NMDevice *device, NMDeviceStateReason *out_failure_reason)
|
|||
GError *error = NULL;
|
||||
guint timeout;
|
||||
NMActRequest *request;
|
||||
NMActiveConnection *master_ac;
|
||||
NMDevice *master;
|
||||
NMActiveConnection *controller_ac;
|
||||
NMDevice *controller;
|
||||
|
||||
nm_clear_g_source(&priv->sup_timeout_id);
|
||||
nm_clear_g_source(&priv->link_timeout_id);
|
||||
|
|
@ -3374,10 +3374,10 @@ act_stage2_config(NMDevice *device, NMDeviceStateReason *out_failure_reason)
|
|||
|
||||
/* Tell the supplicant in which bridge the interface is */
|
||||
if ((request = nm_device_get_act_request(device))
|
||||
&& (master_ac = nm_active_connection_get_controller(NM_ACTIVE_CONNECTION(request)))
|
||||
&& (master = nm_active_connection_get_device(master_ac))
|
||||
&& nm_device_get_device_type(master) == NM_DEVICE_TYPE_BRIDGE) {
|
||||
nm_supplicant_interface_set_bridge(priv->sup_iface, nm_device_get_iface(master));
|
||||
&& (controller_ac = nm_active_connection_get_controller(NM_ACTIVE_CONNECTION(request)))
|
||||
&& (controller = nm_active_connection_get_device(controller_ac))
|
||||
&& nm_device_get_device_type(controller) == NM_DEVICE_TYPE_BRIDGE) {
|
||||
nm_supplicant_interface_set_bridge(priv->sup_iface, nm_device_get_iface(controller));
|
||||
} else
|
||||
nm_supplicant_interface_set_bridge(priv->sup_iface, NULL);
|
||||
|
||||
|
|
|
|||
|
|
@ -349,7 +349,7 @@ device_state_changed(NMActiveConnection *active,
|
|||
}
|
||||
|
||||
static void
|
||||
master_failed(NMActiveConnection *self)
|
||||
controller_failed(NMActiveConnection *self)
|
||||
{
|
||||
NMDevice *device;
|
||||
NMDeviceState device_state;
|
||||
|
|
@ -496,7 +496,7 @@ nm_act_request_class_init(NMActRequestClass *req_class)
|
|||
/* virtual methods */
|
||||
object_class->dispose = dispose;
|
||||
object_class->get_property = get_property;
|
||||
active_class->master_failed = master_failed;
|
||||
active_class->controller_failed = controller_failed;
|
||||
active_class->device_state_changed = device_state_changed;
|
||||
|
||||
/* properties */
|
||||
|
|
|
|||
|
|
@ -157,12 +157,12 @@ static NM_UTILS_FLAGS2STR_DEFINE(
|
|||
_state_flags_to_string,
|
||||
NMActivationStateFlags,
|
||||
NM_UTILS_FLAGS2STR(NM_ACTIVATION_STATE_FLAG_NONE, "none"),
|
||||
NM_UTILS_FLAGS2STR(NM_ACTIVATION_STATE_FLAG_IS_MASTER, "is-master"),
|
||||
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_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, "master-has-slaves"),
|
||||
NM_UTILS_FLAGS2STR(NM_ACTIVATION_STATE_FLAG_MASTER_HAS_SLAVES, "controller-has-slaves"),
|
||||
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,13 +444,13 @@ _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 master/slave, based solely
|
||||
/* we determine whether the connection is a controller/slave, 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))
|
||||
flags_val |= NM_ACTIVATION_STATE_FLAG_IS_SLAVE;
|
||||
|
||||
if (_nm_connection_type_is_master(nm_setting_connection_get_connection_type(s_con)))
|
||||
if (_nm_connection_type_is_controller(nm_setting_connection_get_connection_type(s_con)))
|
||||
flags_val |= NM_ACTIVATION_STATE_FLAG_IS_MASTER;
|
||||
|
||||
nm_active_connection_set_state_flags_full(self,
|
||||
|
|
@ -642,12 +642,12 @@ device_state_changed(NMDevice *device,
|
|||
}
|
||||
|
||||
static void
|
||||
device_master_changed(GObject *object, GParamSpec *pspec, gpointer user_data)
|
||||
device_controller_changed(GObject *object, GParamSpec *pspec, gpointer user_data)
|
||||
{
|
||||
NMDevice *device = NM_DEVICE(object);
|
||||
NMActiveConnection *self = NM_ACTIVE_CONNECTION(user_data);
|
||||
NMActiveConnection *master;
|
||||
NMActiveConnectionState master_state;
|
||||
NMActiveConnection *controller;
|
||||
NMActiveConnectionState controller_state;
|
||||
|
||||
if (NM_ACTIVE_CONNECTION(nm_device_get_act_request(device)) != self)
|
||||
return;
|
||||
|
|
@ -655,14 +655,14 @@ device_master_changed(GObject *object, GParamSpec *pspec, gpointer user_data)
|
|||
return;
|
||||
if (!nm_active_connection_get_controller(self))
|
||||
return;
|
||||
g_signal_handlers_disconnect_by_func(device, G_CALLBACK(device_master_changed), self);
|
||||
g_signal_handlers_disconnect_by_func(device, G_CALLBACK(device_controller_changed), self);
|
||||
|
||||
master = nm_active_connection_get_controller(self);
|
||||
master_state = nm_active_connection_get_state(master);
|
||||
if (master_state >= NM_ACTIVE_CONNECTION_STATE_DEACTIVATING) {
|
||||
/* Master failed before attaching the slave */
|
||||
if (NM_ACTIVE_CONNECTION_GET_CLASS(self)->master_failed)
|
||||
NM_ACTIVE_CONNECTION_GET_CLASS(self)->master_failed(self);
|
||||
controller = nm_active_connection_get_controller(self);
|
||||
controller_state = nm_active_connection_get_state(controller);
|
||||
if (controller_state >= NM_ACTIVE_CONNECTION_STATE_DEACTIVATING) {
|
||||
/* Controller failed before attaching the port */
|
||||
if (NM_ACTIVE_CONNECTION_GET_CLASS(self)->controller_failed)
|
||||
NM_ACTIVE_CONNECTION_GET_CLASS(self)->controller_failed(self);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -704,7 +704,7 @@ nm_active_connection_set_device(NMActiveConnection *self, NMDevice *device)
|
|||
_device_cleanup(self);
|
||||
|
||||
if (device) {
|
||||
/* Device obviously can't be its own master */
|
||||
/* Device obviously can't be its own controller */
|
||||
g_return_val_if_fail(!priv->controller
|
||||
|| device != nm_active_connection_get_device(priv->controller),
|
||||
FALSE);
|
||||
|
|
@ -714,7 +714,7 @@ nm_active_connection_set_device(NMActiveConnection *self, NMDevice *device)
|
|||
g_signal_connect(device, NM_DEVICE_STATE_CHANGED, G_CALLBACK(device_state_changed), self);
|
||||
g_signal_connect(device,
|
||||
"notify::" NM_DEVICE_CONTROLLER,
|
||||
G_CALLBACK(device_master_changed),
|
||||
G_CALLBACK(device_controller_changed),
|
||||
self);
|
||||
g_signal_connect(device,
|
||||
"notify::" NM_DEVICE_METERED,
|
||||
|
|
@ -777,8 +777,8 @@ check_controller_ready(NMActiveConnection *self)
|
|||
gboolean signalling = FALSE;
|
||||
|
||||
/* ActiveConnetions don't enter the ACTIVATING state until they have a
|
||||
* NMDevice in PREPARE or higher states, so the master active connection's
|
||||
* device will be ready to accept slaves when the master is in ACTIVATING
|
||||
* 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
|
||||
* or higher states.
|
||||
*/
|
||||
if (!priv->controller_ready && priv->controller
|
||||
|
|
@ -812,18 +812,18 @@ check_controller_ready(NMActiveConnection *self)
|
|||
}
|
||||
|
||||
static void
|
||||
master_state_cb(NMActiveConnection *master, GParamSpec *pspec, gpointer user_data)
|
||||
controller_state_cb(NMActiveConnection *controller, GParamSpec *pspec, gpointer user_data)
|
||||
{
|
||||
NMActiveConnection *self = NM_ACTIVE_CONNECTION(user_data);
|
||||
NMActiveConnectionPrivate *priv = NM_ACTIVE_CONNECTION_GET_PRIVATE(self);
|
||||
NMActiveConnectionState master_state = nm_active_connection_get_state(master);
|
||||
NMActiveConnection *self = NM_ACTIVE_CONNECTION(user_data);
|
||||
NMActiveConnectionPrivate *priv = NM_ACTIVE_CONNECTION_GET_PRIVATE(self);
|
||||
NMActiveConnectionState controller_state = nm_active_connection_get_state(controller);
|
||||
|
||||
check_controller_ready(self);
|
||||
|
||||
if (master_state == NM_ACTIVE_CONNECTION_STATE_DEACTIVATING && !priv->controller_ready) {
|
||||
/* Master disconnected before the slave was added */
|
||||
if (NM_ACTIVE_CONNECTION_GET_CLASS(self)->master_failed)
|
||||
NM_ACTIVE_CONNECTION_GET_CLASS(self)->master_failed(self);
|
||||
if (controller_state == NM_ACTIVE_CONNECTION_STATE_DEACTIVATING && !priv->controller_ready) {
|
||||
/* Controller disconnected before the port was added */
|
||||
if (NM_ACTIVE_CONNECTION_GET_CLASS(self)->controller_failed)
|
||||
NM_ACTIVE_CONNECTION_GET_CLASS(self)->controller_failed(self);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -880,7 +880,7 @@ nm_active_connection_set_controller(NMActiveConnection *self, NMActiveConnection
|
|||
}
|
||||
|
||||
if (priv->device) {
|
||||
/* Note, the master ActiveConnection may not yet have a device */
|
||||
/* Note, the controller ActiveConnection may not yet have a device */
|
||||
g_return_if_fail(priv->device != nm_active_connection_get_device(controller));
|
||||
}
|
||||
|
||||
|
|
@ -895,7 +895,7 @@ nm_active_connection_set_controller(NMActiveConnection *self, NMActiveConnection
|
|||
|
||||
g_signal_connect(priv->controller,
|
||||
"notify::" NM_ACTIVE_CONNECTION_STATE,
|
||||
G_CALLBACK(master_state_cb),
|
||||
G_CALLBACK(controller_state_cb),
|
||||
self);
|
||||
|
||||
check_controller_ready(self);
|
||||
|
|
@ -1323,7 +1323,9 @@ _device_cleanup(NMActiveConnection *self)
|
|||
|
||||
if (priv->device) {
|
||||
g_signal_handlers_disconnect_by_func(priv->device, G_CALLBACK(device_state_changed), self);
|
||||
g_signal_handlers_disconnect_by_func(priv->device, G_CALLBACK(device_master_changed), self);
|
||||
g_signal_handlers_disconnect_by_func(priv->device,
|
||||
G_CALLBACK(device_controller_changed),
|
||||
self);
|
||||
g_signal_handlers_disconnect_by_func(priv->device,
|
||||
G_CALLBACK(device_metered_changed),
|
||||
self);
|
||||
|
|
@ -1345,7 +1347,7 @@ get_property(GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
|
|||
NMActiveConnection *self = NM_ACTIVE_CONNECTION(object);
|
||||
NMActiveConnectionPrivate *priv = NM_ACTIVE_CONNECTION_GET_PRIVATE(self);
|
||||
char **strv;
|
||||
NMDevice *master_device = NULL;
|
||||
NMDevice *controller_device = NULL;
|
||||
|
||||
switch (prop_id) {
|
||||
/* note that while priv->settings_connection.obj might not be set initially,
|
||||
|
|
@ -1418,8 +1420,8 @@ get_property(GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
|
|||
case PROP_CONTROLLER:
|
||||
case PROP_MASTER:
|
||||
if (priv->controller)
|
||||
master_device = nm_active_connection_get_device(priv->controller);
|
||||
nm_dbus_utils_g_value_set_object_path(value, master_device);
|
||||
controller_device = nm_active_connection_get_device(priv->controller);
|
||||
nm_dbus_utils_g_value_set_object_path(value, controller_device);
|
||||
break;
|
||||
case PROP_INT_SUBJECT:
|
||||
g_value_set_object(value, priv->subject);
|
||||
|
|
@ -1600,7 +1602,9 @@ dispose(GObject *object)
|
|||
_device_cleanup(self);
|
||||
|
||||
if (priv->controller) {
|
||||
g_signal_handlers_disconnect_by_func(priv->controller, G_CALLBACK(master_state_cb), self);
|
||||
g_signal_handlers_disconnect_by_func(priv->controller,
|
||||
G_CALLBACK(controller_state_cb),
|
||||
self);
|
||||
}
|
||||
if (priv->controller_dev) {
|
||||
g_signal_handlers_disconnect_by_func(priv->controller_dev,
|
||||
|
|
|
|||
|
|
@ -80,7 +80,7 @@ typedef struct {
|
|||
NMDeviceState new_state,
|
||||
NMDeviceState old_state,
|
||||
NMDeviceStateReason reason);
|
||||
void (*master_failed)(NMActiveConnection *connection);
|
||||
void (*controller_failed)(NMActiveConnection *connection);
|
||||
|
||||
void (*device_changed)(NMActiveConnection *connection,
|
||||
NMDevice *new_device,
|
||||
|
|
|
|||
|
|
@ -696,7 +696,7 @@ _reconfigure_check(NMBondManager *self, gboolean reapply)
|
|||
/* Find all the connected ports that are IFF_RUNNING. */
|
||||
pl_links_head_entry = nm_platform_lookup_obj_type(self->platform, NMP_OBJECT_TYPE_LINK);
|
||||
nmp_cache_iter_for_each_link (&pliter, pl_links_head_entry, &plink_port) {
|
||||
if (plink_port->master != self->ifindex)
|
||||
if (plink_port->controller != self->ifindex)
|
||||
continue;
|
||||
if (!NM_FLAGS_HAS(plink_port->n_ifi_flags, IFF_RUNNING))
|
||||
continue;
|
||||
|
|
@ -814,7 +814,7 @@ _link_changed_cb(NMPlatform *platform,
|
|||
if (ifindex == self->ifindex)
|
||||
goto schedule;
|
||||
|
||||
if (plink->master == self->ifindex)
|
||||
if (plink->controller == self->ifindex)
|
||||
goto schedule;
|
||||
|
||||
if (g_hash_table_contains(self->previous_ifindexes, GINT_TO_POINTER(ifindex)))
|
||||
|
|
|
|||
|
|
@ -383,7 +383,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 *master,
|
||||
const char *controller,
|
||||
const char *slave_type)
|
||||
{
|
||||
const char *value;
|
||||
|
|
@ -393,14 +393,14 @@ nm_config_data_get_ignore_carrier_for_port(const NMConfigData *self,
|
|||
|
||||
g_return_val_if_fail(NM_IS_CONFIG_DATA(self), FALSE);
|
||||
|
||||
if (!master || !slave_type)
|
||||
if (!controller || !slave_type)
|
||||
goto out_default;
|
||||
|
||||
if (!nm_utils_ifname_valid_kernel(master, NULL))
|
||||
if (!nm_utils_ifname_valid_kernel(controller, NULL))
|
||||
goto out_default;
|
||||
|
||||
match_data = (NMMatchSpecDeviceData){
|
||||
.interface_name = master,
|
||||
.interface_name = controller,
|
||||
.device_type = slave_type,
|
||||
};
|
||||
|
||||
|
|
@ -422,7 +422,7 @@ nm_config_data_get_ignore_carrier_for_port(const NMConfigData *self,
|
|||
return m;
|
||||
|
||||
out_default:
|
||||
/* if ignore-carrier is not explicitly or detected for the master, then we assume it's
|
||||
/* if ignore-carrier is not explicitly or detected for the controller, then we assume it's
|
||||
* enabled. This is in line with nm_config_data_get_ignore_carrier_by_device(), where
|
||||
* ignore-carrier is enabled based on nm_device_ignore_carrier_by_default().
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -188,7 +188,7 @@ const char *nm_config_data_get_rc_manager(const NMConfigData *self);
|
|||
gboolean nm_config_data_get_systemd_resolved(const NMConfigData *self);
|
||||
|
||||
gboolean nm_config_data_get_ignore_carrier_for_port(const NMConfigData *self,
|
||||
const char *master,
|
||||
const char *controller,
|
||||
const char *slave_type);
|
||||
|
||||
gboolean nm_config_data_get_ignore_carrier_by_device(const NMConfigData *self, NMDevice *device);
|
||||
|
|
|
|||
|
|
@ -3083,7 +3083,7 @@ nm_l3_config_data_new_from_platform(NMDedupMultiIndex *multi_idx,
|
|||
nm_assert(ifindex > 0);
|
||||
|
||||
/* Slaves have no IP configuration */
|
||||
if (nm_platform_link_get_master(platform, ifindex) > 0)
|
||||
if (nm_platform_link_get_controller(platform, ifindex) > 0)
|
||||
return NULL;
|
||||
|
||||
self = nm_l3_config_data_new(multi_idx, ifindex, NM_IP_CONFIG_SOURCE_KERNEL);
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -1844,9 +1844,9 @@ unblock_autoconnect_for_children(NMPolicy *self,
|
|||
|
||||
static void
|
||||
unblock_autoconnect_for_ports(NMPolicy *self,
|
||||
const char *master_device,
|
||||
const char *master_uuid_settings,
|
||||
const char *master_uuid_applied,
|
||||
const char *controller_device,
|
||||
const char *controller_uuid_settings,
|
||||
const char *controller_uuid_applied,
|
||||
gboolean reset_devcon_autoconnect)
|
||||
{
|
||||
NMPolicyPrivate *priv = NM_POLICY_GET_PRIVATE(self);
|
||||
|
|
@ -1857,11 +1857,11 @@ unblock_autoconnect_for_ports(NMPolicy *self,
|
|||
_LOGT(LOGD_CORE,
|
||||
"block-autoconnect: unblocking port profiles for controller ifname=%s%s%s, uuid=%s%s%s"
|
||||
"%s%s%s",
|
||||
NM_PRINT_FMT_QUOTE_STRING(master_device),
|
||||
NM_PRINT_FMT_QUOTE_STRING(master_uuid_settings),
|
||||
NM_PRINT_FMT_QUOTED(master_uuid_applied,
|
||||
NM_PRINT_FMT_QUOTE_STRING(controller_device),
|
||||
NM_PRINT_FMT_QUOTE_STRING(controller_uuid_settings),
|
||||
NM_PRINT_FMT_QUOTED(controller_uuid_applied,
|
||||
", applied-uuid=\"",
|
||||
master_uuid_applied,
|
||||
controller_uuid_applied,
|
||||
"\"",
|
||||
""));
|
||||
|
||||
|
|
@ -1870,15 +1870,18 @@ unblock_autoconnect_for_ports(NMPolicy *self,
|
|||
for (i = 0; connections[i]; i++) {
|
||||
NMSettingsConnection *sett_conn = connections[i];
|
||||
NMSettingConnection *s_slave_con;
|
||||
const char *slave_master;
|
||||
const char *slave_controller;
|
||||
|
||||
s_slave_con =
|
||||
nm_settings_connection_get_setting(sett_conn, NM_META_SETTING_TYPE_CONNECTION);
|
||||
slave_master = nm_setting_connection_get_controller(s_slave_con);
|
||||
if (!slave_master)
|
||||
slave_controller = nm_setting_connection_get_controller(s_slave_con);
|
||||
if (!slave_controller)
|
||||
continue;
|
||||
|
||||
if (!NM_IN_STRSET(slave_master, master_device, master_uuid_applied, master_uuid_settings))
|
||||
if (!NM_IN_STRSET(slave_controller,
|
||||
controller_device,
|
||||
controller_uuid_applied,
|
||||
controller_uuid_settings))
|
||||
continue;
|
||||
|
||||
if (reset_devcon_autoconnect) {
|
||||
|
|
@ -1905,8 +1908,8 @@ unblock_autoconnect_for_ports(NMPolicy *self,
|
|||
static void
|
||||
unblock_autoconnect_for_ports_for_sett_conn(NMPolicy *self, NMSettingsConnection *sett_conn)
|
||||
{
|
||||
const char *master_device;
|
||||
const char *master_uuid_settings;
|
||||
const char *controller_device;
|
||||
const char *controller_uuid_settings;
|
||||
NMSettingConnection *s_con;
|
||||
|
||||
nm_assert(NM_IS_POLICY(self));
|
||||
|
|
@ -1916,10 +1919,10 @@ unblock_autoconnect_for_ports_for_sett_conn(NMPolicy *self, NMSettingsConnection
|
|||
|
||||
nm_assert(NM_IS_SETTING_CONNECTION(s_con));
|
||||
|
||||
master_uuid_settings = nm_setting_connection_get_uuid(s_con);
|
||||
master_device = nm_setting_connection_get_interface_name(s_con);
|
||||
controller_uuid_settings = nm_setting_connection_get_uuid(s_con);
|
||||
controller_device = nm_setting_connection_get_interface_name(s_con);
|
||||
|
||||
unblock_autoconnect_for_ports(self, master_device, master_uuid_settings, NULL, TRUE);
|
||||
unblock_autoconnect_for_ports(self, controller_device, controller_uuid_settings, NULL, TRUE);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
|||
|
|
@ -589,11 +589,11 @@ link_changed(NMPlatform *platform,
|
|||
ip6_address_delete(platform, device->obj->link.ifindex, device->ip6_lladdr, 64);
|
||||
}
|
||||
|
||||
if (device->obj->link.master) {
|
||||
NMFakePlatformLink *master;
|
||||
if (device->obj->link.controller) {
|
||||
NMFakePlatformLink *controller;
|
||||
|
||||
master = link_get(platform, device->obj->link.master);
|
||||
link_set_obj(platform, master, NULL);
|
||||
controller = link_get(platform, device->obj->link.controller);
|
||||
link_set_obj(platform, controller, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -736,20 +736,20 @@ link_change(NMPlatform *platform,
|
|||
}
|
||||
|
||||
static gboolean
|
||||
link_enslave(NMPlatform *platform, int master, int slave)
|
||||
link_enslave(NMPlatform *platform, int controller, int slave)
|
||||
{
|
||||
NMFakePlatformLink *device = link_get(platform, slave);
|
||||
NMFakePlatformLink *master_device = link_get(platform, master);
|
||||
NMFakePlatformLink *device = link_get(platform, slave);
|
||||
NMFakePlatformLink *controller_device = link_get(platform, controller);
|
||||
|
||||
g_return_val_if_fail(device, FALSE);
|
||||
g_return_val_if_fail(master_device, FALSE);
|
||||
g_return_val_if_fail(controller_device, FALSE);
|
||||
|
||||
if (device->obj->link.master != master) {
|
||||
if (device->obj->link.controller != controller) {
|
||||
nm_auto_nmpobj NMPObject *obj_tmp = NULL;
|
||||
|
||||
obj_tmp = nmp_object_clone(device->obj, FALSE);
|
||||
obj_tmp->link.master = master;
|
||||
if (NM_IN_SET(master_device->obj->link.type, NM_LINK_TYPE_BOND, NM_LINK_TYPE_TEAM))
|
||||
obj_tmp = nmp_object_clone(device->obj, FALSE);
|
||||
obj_tmp->link.controller = controller;
|
||||
if (NM_IN_SET(controller_device->obj->link.type, NM_LINK_TYPE_BOND, NM_LINK_TYPE_TEAM))
|
||||
obj_tmp->link.n_ifi_flags = NM_FLAGS_SET(device->obj->link.n_ifi_flags, IFF_UP);
|
||||
link_set_obj(platform, device, obj_tmp);
|
||||
}
|
||||
|
|
@ -758,20 +758,20 @@ link_enslave(NMPlatform *platform, int master, int slave)
|
|||
}
|
||||
|
||||
static gboolean
|
||||
link_release(NMPlatform *platform, int master_idx, int slave_idx)
|
||||
link_release(NMPlatform *platform, int controller_idx, int slave_idx)
|
||||
{
|
||||
NMFakePlatformLink *master = link_get(platform, master_idx);
|
||||
NMFakePlatformLink *slave = link_get(platform, slave_idx);
|
||||
nm_auto_nmpobj NMPObject *obj_tmp = NULL;
|
||||
NMFakePlatformLink *controller = link_get(platform, controller_idx);
|
||||
NMFakePlatformLink *slave = link_get(platform, slave_idx);
|
||||
nm_auto_nmpobj NMPObject *obj_tmp = NULL;
|
||||
|
||||
g_return_val_if_fail(master, FALSE);
|
||||
g_return_val_if_fail(controller, FALSE);
|
||||
g_return_val_if_fail(slave, FALSE);
|
||||
|
||||
if (slave->obj->link.master != master->obj->link.ifindex)
|
||||
if (slave->obj->link.controller != controller->obj->link.ifindex)
|
||||
return FALSE;
|
||||
|
||||
obj_tmp = nmp_object_clone(slave->obj, FALSE);
|
||||
obj_tmp->link.master = 0;
|
||||
obj_tmp = nmp_object_clone(slave->obj, FALSE);
|
||||
obj_tmp->link.controller = 0;
|
||||
link_set_obj(platform, slave, obj_tmp);
|
||||
return TRUE;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -261,7 +261,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_cmpint(nm_platform_link_get_master(NM_PLATFORM_GET, ifindex_port), ==, controller);
|
||||
g_assert_cmpint(nm_platform_link_get_controller(NM_PLATFORM_GET, ifindex_port), ==, controller);
|
||||
|
||||
accept_signals(link_changed, 1, 3);
|
||||
accept_signals(controller_changed, 0, 2);
|
||||
|
|
@ -424,7 +424,7 @@ test_port(int controller, int port_type, SignalData *controller_changed)
|
|||
ensure_no_signal(link_changed);
|
||||
ensure_no_signal(link_removed);
|
||||
g_assert(nm_platform_link_release(NM_PLATFORM_GET, controller, ifindex_port));
|
||||
g_assert_cmpint(nm_platform_link_get_master(NM_PLATFORM_GET, ifindex_port), ==, 0);
|
||||
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);
|
||||
accept_signals(link_changed, 1, 5);
|
||||
|
|
@ -517,28 +517,29 @@ test_software(NMLinkType link_type, const char *link_typename)
|
|||
g_assert(nm_platform_link_uses_arp(NM_PLATFORM_GET, ifindex));
|
||||
accept_signal(link_changed);
|
||||
|
||||
/* Set master option */
|
||||
/* Set controller option */
|
||||
if (nmtstp_is_root_test()) {
|
||||
switch (link_type) {
|
||||
case NM_LINK_TYPE_BRIDGE:
|
||||
if (nmtstp_is_sysfs_writable()) {
|
||||
g_assert(nm_platform_sysctl_master_set_option(NM_PLATFORM_GET,
|
||||
ifindex,
|
||||
"forward_delay",
|
||||
"628"));
|
||||
value =
|
||||
nm_platform_sysctl_master_get_option(NM_PLATFORM_GET, ifindex, "forward_delay");
|
||||
g_assert(nm_platform_sysctl_controller_set_option(NM_PLATFORM_GET,
|
||||
ifindex,
|
||||
"forward_delay",
|
||||
"628"));
|
||||
value = nm_platform_sysctl_controller_get_option(NM_PLATFORM_GET,
|
||||
ifindex,
|
||||
"forward_delay");
|
||||
g_assert_cmpstr(value, ==, "628");
|
||||
g_free(value);
|
||||
}
|
||||
break;
|
||||
case NM_LINK_TYPE_BOND:
|
||||
if (nmtstp_is_sysfs_writable()) {
|
||||
g_assert(nm_platform_sysctl_master_set_option(NM_PLATFORM_GET,
|
||||
ifindex,
|
||||
"mode",
|
||||
"active-backup"));
|
||||
value = nm_platform_sysctl_master_get_option(NM_PLATFORM_GET, ifindex, "mode");
|
||||
g_assert(nm_platform_sysctl_controller_set_option(NM_PLATFORM_GET,
|
||||
ifindex,
|
||||
"mode",
|
||||
"active-backup"));
|
||||
value = nm_platform_sysctl_controller_get_option(NM_PLATFORM_GET, ifindex, "mode");
|
||||
/* When reading back, the output looks slightly different. */
|
||||
g_assert(g_str_has_prefix(value, "active-backup"));
|
||||
g_free(value);
|
||||
|
|
@ -2908,7 +2909,7 @@ test_nl_bugs_spuroius_newlink(void)
|
|||
pllink = nm_platform_link_get(NM_PLATFORM_GET, ifindex_dummy0);
|
||||
g_assert(pllink);
|
||||
g_assert(!nm_platform_link_get_permanent_address(NM_PLATFORM_GET, pllink, &hw_perm_addr));
|
||||
if (pllink->master == ifindex_bond0)
|
||||
if (pllink->controller == ifindex_bond0)
|
||||
break;
|
||||
});
|
||||
|
||||
|
|
@ -2965,7 +2966,7 @@ test_nl_bugs_spuroius_dellink(void)
|
|||
pllink = nm_platform_link_get(NM_PLATFORM_GET, ifindex_dummy0);
|
||||
g_assert(pllink);
|
||||
g_assert(!nm_platform_link_get_permanent_address(NM_PLATFORM_GET, pllink, &hw_perm_addr));
|
||||
if (pllink->master == ifindex_bridge0)
|
||||
if (pllink->controller == ifindex_bridge0)
|
||||
break;
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ typedef enum {
|
|||
NM_PPP_STATUS_TERMINATE = 9,
|
||||
NM_PPP_STATUS_DISCONNECT = 10,
|
||||
NM_PPP_STATUS_HOLDOFF = 11,
|
||||
NM_PPP_STATUS_MASTER = 12,
|
||||
NM_PPP_STATUS_CONTROLLER = 12,
|
||||
|
||||
/* these states are internal and not announced by the pppd plugin. */
|
||||
NM_PPP_STATUS_INTERN_UNKNOWN = 20,
|
||||
|
|
|
|||
|
|
@ -91,7 +91,7 @@ G_STATIC_ASSERT((gint64) NM_PPP_STATUS_RUNNING == PHASE_RUNNING);
|
|||
G_STATIC_ASSERT((gint64) NM_PPP_STATUS_TERMINATE == PHASE_TERMINATE);
|
||||
G_STATIC_ASSERT((gint64) NM_PPP_STATUS_DISCONNECT == PHASE_DISCONNECT);
|
||||
G_STATIC_ASSERT((gint64) NM_PPP_STATUS_HOLDOFF == PHASE_HOLDOFF);
|
||||
G_STATIC_ASSERT((gint64) NM_PPP_STATUS_MASTER == PHASE_MASTER);
|
||||
G_STATIC_ASSERT((gint64) NM_PPP_STATUS_CONTROLLER == PHASE_MASTER);
|
||||
|
||||
G_STATIC_ASSERT(NM_PPPD_COMPAT_MAXNAMELEN == MAXNAMELEN);
|
||||
G_STATIC_ASSERT(NM_PPPD_COMPAT_MAXSECRETLEN == MAXSECRETLEN);
|
||||
|
|
|
|||
|
|
@ -73,8 +73,8 @@ nm_phasechange(int arg)
|
|||
case NM_PPP_STATUS_HOLDOFF:
|
||||
ppp_phase = "holdoff";
|
||||
break;
|
||||
case NM_PPP_STATUS_MASTER:
|
||||
ppp_phase = "master";
|
||||
case NM_PPP_STATUS_CONTROLLER:
|
||||
ppp_phase = "controller";
|
||||
break;
|
||||
|
||||
default:
|
||||
|
|
|
|||
|
|
@ -290,17 +290,17 @@ check_if_bond_slave(shvarFile *ifcfg, NMSettingConnection *s_con)
|
|||
{
|
||||
gs_free char *value = NULL;
|
||||
const char *v;
|
||||
const char *master;
|
||||
const char *controller;
|
||||
|
||||
v = svGetValueStr(ifcfg, "MASTER_UUID", &value);
|
||||
if (!v)
|
||||
v = svGetValueStr(ifcfg, "MASTER", &value);
|
||||
|
||||
if (v) {
|
||||
master = nm_setting_connection_get_controller(s_con);
|
||||
if (master) {
|
||||
controller = nm_setting_connection_get_controller(s_con);
|
||||
if (controller) {
|
||||
PARSE_WARNING("Already configured as slave of %s. Ignoring MASTER{_UUID}=\"%s\"",
|
||||
master,
|
||||
controller,
|
||||
v);
|
||||
return;
|
||||
}
|
||||
|
|
@ -323,7 +323,7 @@ check_if_team_slave(shvarFile *ifcfg, NMSettingConnection *s_con)
|
|||
{
|
||||
gs_free char *value = NULL;
|
||||
const char *v;
|
||||
const char *master;
|
||||
const char *controller;
|
||||
|
||||
v = svGetValueStr(ifcfg, "TEAM_MASTER_UUID", &value);
|
||||
if (!v)
|
||||
|
|
@ -331,10 +331,10 @@ check_if_team_slave(shvarFile *ifcfg, NMSettingConnection *s_con)
|
|||
if (!v)
|
||||
return;
|
||||
|
||||
master = nm_setting_connection_get_controller(s_con);
|
||||
if (master) {
|
||||
controller = nm_setting_connection_get_controller(s_con);
|
||||
if (controller) {
|
||||
PARSE_WARNING("Already configured as slave of %s. Ignoring TEAM_MASTER{_UUID}=\"%s\"",
|
||||
master,
|
||||
controller,
|
||||
v);
|
||||
return;
|
||||
}
|
||||
|
|
@ -6683,7 +6683,7 @@ connection_from_file_full(const char *filename,
|
|||
gs_free char *bond_options = NULL;
|
||||
|
||||
if (svGetValueStr(main_ifcfg, "BONDING_OPTS", &bond_options)) {
|
||||
/* initscripts consider these as bond masters */
|
||||
/* initscripts consider these as bond controllers */
|
||||
g_free(type);
|
||||
type = g_strdup(TYPE_BOND);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2161,7 +2161,7 @@ write_connection_setting(NMSettingConnection *s_con, shvarFile *ifcfg, const cha
|
|||
{
|
||||
guint32 n, i;
|
||||
nm_auto_free_gstring GString *str = NULL;
|
||||
const char *master, *master_iface = NULL, *type;
|
||||
const char *controller, *controller_iface = NULL, *type;
|
||||
int vint;
|
||||
gint32 vint32;
|
||||
NMSettingConnectionMdns mdns;
|
||||
|
|
@ -2191,9 +2191,9 @@ write_connection_setting(NMSettingConnection *s_con, shvarFile *ifcfg, const cha
|
|||
vint = nm_setting_connection_get_multi_connect(s_con);
|
||||
svSetValueInt64_cond(ifcfg, "MULTI_CONNECT", vint != NM_CONNECTION_MULTI_CONNECT_DEFAULT, vint);
|
||||
|
||||
/* Only save the value for master connections */
|
||||
/* Only save the value for controller connections */
|
||||
type = nm_setting_connection_get_connection_type(s_con);
|
||||
if (_nm_connection_type_is_master(type)) {
|
||||
if (_nm_connection_type_is_controller(type)) {
|
||||
NMSettingConnectionAutoconnectSlaves autoconnect_slaves;
|
||||
autoconnect_slaves = nm_setting_connection_get_autoconnect_slaves(s_con);
|
||||
svSetValueStr(ifcfg,
|
||||
|
|
@ -2251,50 +2251,50 @@ write_connection_setting(NMSettingConnection *s_con, shvarFile *ifcfg, const cha
|
|||
mud_url = nm_setting_connection_get_mud_url(s_con);
|
||||
svSetValue(ifcfg, "MUD_URL", mud_url);
|
||||
|
||||
master = nm_setting_connection_get_controller(s_con);
|
||||
if (master) {
|
||||
controller = nm_setting_connection_get_controller(s_con);
|
||||
if (controller) {
|
||||
/* The reader prefers the *_UUID variants, however we still try to resolve
|
||||
* it into an interface name, so that legacy tooling is not confused. */
|
||||
if (!nm_utils_get_testing()) {
|
||||
/* This is conditional for easier testing. */
|
||||
master_iface = nm_manager_iface_for_uuid(NM_MANAGER_GET, master);
|
||||
controller_iface = nm_manager_iface_for_uuid(NM_MANAGER_GET, controller);
|
||||
}
|
||||
if (!master_iface) {
|
||||
master_iface = master;
|
||||
master = NULL;
|
||||
if (!controller_iface) {
|
||||
controller_iface = controller;
|
||||
controller = NULL;
|
||||
}
|
||||
|
||||
if (nm_streq0(nm_setting_connection_get_port_type(s_con), NM_SETTING_BOND_SETTING_NAME)) {
|
||||
svSetValueStr(ifcfg, "MASTER_UUID", master);
|
||||
svSetValueStr(ifcfg, "MASTER", master_iface);
|
||||
svSetValueStr(ifcfg, "MASTER_UUID", controller);
|
||||
svSetValueStr(ifcfg, "MASTER", controller_iface);
|
||||
svSetValueStr(ifcfg, "SLAVE", "yes");
|
||||
} else if (nm_streq0(nm_setting_connection_get_port_type(s_con),
|
||||
NM_SETTING_BRIDGE_SETTING_NAME)) {
|
||||
svSetValueStr(ifcfg, "BRIDGE_UUID", master);
|
||||
svSetValueStr(ifcfg, "BRIDGE", master_iface);
|
||||
svSetValueStr(ifcfg, "BRIDGE_UUID", controller);
|
||||
svSetValueStr(ifcfg, "BRIDGE", controller_iface);
|
||||
} else if (nm_streq0(nm_setting_connection_get_port_type(s_con),
|
||||
NM_SETTING_TEAM_SETTING_NAME)) {
|
||||
svSetValueStr(ifcfg, "TEAM_MASTER_UUID", master);
|
||||
svSetValueStr(ifcfg, "TEAM_MASTER", master_iface);
|
||||
svSetValueStr(ifcfg, "TEAM_MASTER_UUID", controller);
|
||||
svSetValueStr(ifcfg, "TEAM_MASTER", controller_iface);
|
||||
if (NM_IN_STRSET(type, NM_SETTING_WIRED_SETTING_NAME, NM_SETTING_VLAN_SETTING_NAME))
|
||||
svUnsetValue(ifcfg, "TYPE");
|
||||
} else if (nm_streq0(nm_setting_connection_get_port_type(s_con),
|
||||
NM_SETTING_OVS_PORT_SETTING_NAME)) {
|
||||
svSetValueStr(ifcfg, "OVS_PORT_UUID", master);
|
||||
svSetValueStr(ifcfg, "OVS_PORT", master_iface);
|
||||
svSetValueStr(ifcfg, "OVS_PORT_UUID", controller);
|
||||
svSetValueStr(ifcfg, "OVS_PORT", controller_iface);
|
||||
} else if (nm_streq0(nm_setting_connection_get_port_type(s_con),
|
||||
NM_SETTING_VRF_SETTING_NAME)) {
|
||||
svSetValueStr(ifcfg, "VRF_UUID", master);
|
||||
svSetValueStr(ifcfg, "VRF", master_iface);
|
||||
svSetValueStr(ifcfg, "VRF_UUID", controller);
|
||||
svSetValueStr(ifcfg, "VRF", controller_iface);
|
||||
} else {
|
||||
_LOGW("don't know how to set master for a %s slave",
|
||||
_LOGW("don't know how to set controller for a %s slave",
|
||||
nm_setting_connection_get_port_type(s_con));
|
||||
}
|
||||
}
|
||||
|
||||
if (nm_streq0(type, NM_SETTING_TEAM_SETTING_NAME))
|
||||
svSetValueStr(ifcfg, "DEVICETYPE", TYPE_TEAM);
|
||||
else if (master_iface
|
||||
else if (controller_iface
|
||||
&& nm_streq0(nm_setting_connection_get_port_type(s_con), NM_SETTING_TEAM_SETTING_NAME))
|
||||
svSetValueStr(ifcfg, "DEVICETYPE", TYPE_TEAM_PORT);
|
||||
|
||||
|
|
|
|||
|
|
@ -2212,7 +2212,7 @@ test_read_dns_options(void)
|
|||
}
|
||||
|
||||
static void
|
||||
test_clear_master(void)
|
||||
test_clear_controller(void)
|
||||
{
|
||||
nmtst_auto_unlinkfile char *testfile = NULL;
|
||||
gs_free char *keyfile = NULL;
|
||||
|
|
@ -2239,7 +2239,7 @@ test_clear_master(void)
|
|||
TEST_IFCFG_DIR "/ifcfg-System_test-bridge-component-a.cexpected",
|
||||
&testfile);
|
||||
|
||||
/* 3. clear master and slave-type */
|
||||
/* 3. clear controller and slave-type */
|
||||
g_object_set(s_con,
|
||||
NM_SETTING_CONNECTION_MASTER,
|
||||
NULL,
|
||||
|
|
@ -8990,7 +8990,7 @@ test_write_fcoe_mode(gconstpointer user_data)
|
|||
}
|
||||
|
||||
static void
|
||||
test_read_team_master(gconstpointer user_data)
|
||||
test_read_team_controller(gconstpointer user_data)
|
||||
{
|
||||
const char *const PATH_NAME = user_data;
|
||||
gs_unref_object NMConnection *connection = NULL;
|
||||
|
|
@ -9013,7 +9013,7 @@ test_read_team_master(gconstpointer user_data)
|
|||
}
|
||||
|
||||
static void
|
||||
test_read_team_master_invalid(gconstpointer user_data)
|
||||
test_read_team_controller_invalid(gconstpointer user_data)
|
||||
{
|
||||
const char *const PATH_NAME = user_data;
|
||||
gs_free_error GError *error = NULL;
|
||||
|
|
@ -9029,7 +9029,7 @@ test_read_team_master_invalid(gconstpointer user_data)
|
|||
}
|
||||
|
||||
static void
|
||||
test_write_team_master(void)
|
||||
test_write_team_controller(void)
|
||||
{
|
||||
nmtst_auto_unlinkfile char *testfile = NULL;
|
||||
gs_unref_object NMConnection *connection = NULL;
|
||||
|
|
@ -9252,7 +9252,7 @@ test_team_reread_slave(void)
|
|||
"type=vlan\n"
|
||||
"autoconnect=false\n"
|
||||
"interface-name=enp31s0f1-142\n"
|
||||
"master=team142\n"
|
||||
"controller=team142\n"
|
||||
"permissions=\n"
|
||||
"slave-type=team\n"
|
||||
"\n"
|
||||
|
|
@ -10534,7 +10534,7 @@ main(int argc, char **argv)
|
|||
test_write_wired_static_ip6_only_gw);
|
||||
g_test_add_func(TPATH "ip6/disabled", test_write_ip6_disabled);
|
||||
g_test_add_func(TPATH "read-dns-options", test_read_dns_options);
|
||||
g_test_add_func(TPATH "clear-master", test_clear_master);
|
||||
g_test_add_func(TPATH "clear-controller", test_clear_controller);
|
||||
|
||||
nmtst_add_test_func(TPATH "read-static",
|
||||
test_read_wired_static,
|
||||
|
|
@ -10892,33 +10892,33 @@ main(int argc, char **argv)
|
|||
(gpointer) NM_SETTING_DCB_FCOE_MODE_VN2VN,
|
||||
test_write_fcoe_mode);
|
||||
|
||||
g_test_add_func(TPATH "bond/read-master", test_read_bond_main);
|
||||
g_test_add_func(TPATH "bond/read-master-eth-type", test_read_bond_eth_type);
|
||||
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/write-master", test_write_bond_main);
|
||||
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/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 "bridge/read-master", test_read_bridge_main);
|
||||
g_test_add_func(TPATH "bridge/write-master", test_write_bridge_main);
|
||||
g_test_add_func(TPATH "bridge/read-controller", test_read_bridge_main);
|
||||
g_test_add_func(TPATH "bridge/write-controller", test_write_bridge_main);
|
||||
g_test_add_func(TPATH "bridge/read-component", test_read_bridge_component);
|
||||
g_test_add_func(TPATH "bridge/write-component", test_write_bridge_component);
|
||||
g_test_add_func(TPATH "bridge/read-missing-stp", test_read_bridge_missing_stp);
|
||||
|
||||
g_test_add_data_func(TPATH "team/read-master-1",
|
||||
TEST_IFCFG_DIR "/ifcfg-test-team-master-1",
|
||||
test_read_team_master);
|
||||
g_test_add_data_func(TPATH "team/read-master-2",
|
||||
TEST_IFCFG_DIR "/ifcfg-test-team-master-2",
|
||||
test_read_team_master);
|
||||
g_test_add_data_func(TPATH "team/read-master-invalid",
|
||||
TEST_IFCFG_DIR "/ifcfg-test-team-master-invalid",
|
||||
test_read_team_master_invalid);
|
||||
g_test_add_func(TPATH "team/write-master", test_write_team_master);
|
||||
g_test_add_data_func(TPATH "team/read-controller-1",
|
||||
TEST_IFCFG_DIR "/ifcfg-test-team-controller-1",
|
||||
test_read_team_controller);
|
||||
g_test_add_data_func(TPATH "team/read-controller-2",
|
||||
TEST_IFCFG_DIR "/ifcfg-test-team-controller-2",
|
||||
test_read_team_controller);
|
||||
g_test_add_data_func(TPATH "team/read-controller-invalid",
|
||||
TEST_IFCFG_DIR "/ifcfg-test-team-controller-invalid",
|
||||
test_read_team_controller_invalid);
|
||||
g_test_add_func(TPATH "team/write-controller", test_write_team_controller);
|
||||
g_test_add_data_func(TPATH "team/read-port-1",
|
||||
TEST_IFCFG_DIR "/ifcfg-test-team-port-1",
|
||||
test_read_team_port);
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
id=Test Bridge Component
|
||||
uuid=d7b4f96c-c45e-4298-bef8-f48574f8c1c0
|
||||
type=802-3-ethernet
|
||||
master=br0
|
||||
controller=br0
|
||||
slave-type=bridge
|
||||
|
||||
[802-3-ethernet]
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
[connection]
|
||||
type=802-3-ethernet
|
||||
master=br0
|
||||
controller=br0
|
||||
slave-type=bridge
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
[connection]
|
||||
master=br0
|
||||
controller=br0
|
||||
|
||||
[802-3-ethernet]
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
[connection]
|
||||
master=br0
|
||||
controller=br0
|
||||
slave-type=bridge
|
||||
[802-3-ethernet]
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
[connection]
|
||||
type=802-3-ethernet
|
||||
master=br0
|
||||
controller=br0
|
||||
[bridge-port]
|
||||
|
|
|
|||
|
|
@ -303,7 +303,7 @@ test_nm_utils_log_connection_diff(void)
|
|||
NM_SETTING_CONNECTION_ID,
|
||||
"id2",
|
||||
NM_SETTING_CONNECTION_CONTROLLER,
|
||||
"master2",
|
||||
"controller2",
|
||||
NULL);
|
||||
nm_utils_log_connection_diff(connection,
|
||||
connection2,
|
||||
|
|
|
|||
|
|
@ -381,9 +381,9 @@ nm_active_connection_get_vpn(NMActiveConnection *connection)
|
|||
* nm_active_connection_get_master:
|
||||
* @connection: a #NMActiveConnection
|
||||
*
|
||||
* Gets the master #NMDevice of the connection.
|
||||
* Gets the controller #NMDevice of the connection.
|
||||
*
|
||||
* Returns: (transfer none): the master #NMDevice of the #NMActiveConnection.
|
||||
* Returns: (transfer none): the controller #NMDevice of the #NMActiveConnection.
|
||||
*
|
||||
* Deprecated: 1.44: Use nm_active_connection_get_controller() instead.
|
||||
**/
|
||||
|
|
@ -880,7 +880,7 @@ nm_active_connection_class_init(NMActiveConnectionClass *klass)
|
|||
/**
|
||||
* NMActiveConnection:master:
|
||||
*
|
||||
* The master device if one exists. Replaced by the "controller" property.
|
||||
* The controller device if one exists. Replaced by the "controller" property.
|
||||
*
|
||||
* Deprecated: 1.44
|
||||
**/
|
||||
|
|
|
|||
|
|
@ -9221,17 +9221,17 @@ nm_client_wait_shutdown_finish(GAsyncResult *result, GError **error)
|
|||
|
||||
/*****************************************************************************
|
||||
* Backported symbols. Usually, new API is only added in new major versions
|
||||
* of NetworkManager (that is, on "master" branch). Sometimes however, we might
|
||||
* of NetworkManager (that is, on "main" branch). Sometimes however, we might
|
||||
* have to backport some API to an older stable branch. In that case, we backport
|
||||
* the symbols with a different version corresponding to the minor API.
|
||||
*
|
||||
* To allow upgrading from such a extended minor-release, "master" contains these
|
||||
* To allow upgrading from such a extended minor-release, "main" contains these
|
||||
* backported symbols too.
|
||||
*
|
||||
* For example, 1.2.0 added nm_setting_connection_autoconnect_slaves_get_type.
|
||||
* This was backported for 1.0.4 as nm_setting_connection_autoconnect_slaves_get_type@libnm_1_0_4
|
||||
* To allow an application that was linked against 1.0.4 to seamlessly upgrade to
|
||||
* a newer major version, the same symbols is also exposed on "master". Note, that
|
||||
* a newer major version, the same symbols is also exposed on "main". Note, that
|
||||
* a user can only seamlessly upgrade to a newer major version, that is released
|
||||
* *after* 1.0.4 is out. In this example, 1.2.0 was released after 1.4.0, and thus
|
||||
* a 1.0.4 user can upgrade to 1.2.0 ABI.
|
||||
|
|
|
|||
|
|
@ -1893,7 +1893,7 @@ _nm_connection_verify(NMConnection *connection, GError **error)
|
|||
_("setting is required for non-slave connections"));
|
||||
g_prefix_error(&normalizable_error, "%s: ", NM_SETTING_IP4_CONFIG_SETTING_NAME);
|
||||
|
||||
/* having a master without IP config was not a verify() error, accept
|
||||
/* having a controller without IP config was not a verify() error, accept
|
||||
* it for backward compatibility. */
|
||||
normalizable_error_type = NM_SETTING_VERIFY_NORMALIZABLE;
|
||||
}
|
||||
|
|
@ -1918,7 +1918,7 @@ _nm_connection_verify(NMConnection *connection, GError **error)
|
|||
_("setting is required for non-slave connections"));
|
||||
g_prefix_error(&normalizable_error, "%s: ", NM_SETTING_IP6_CONFIG_SETTING_NAME);
|
||||
|
||||
/* having a master without IP config was not a verify() error, accept
|
||||
/* having a controller without IP config was not a verify() error, accept
|
||||
* it for backward compatibility. */
|
||||
normalizable_error_type = NM_SETTING_VERIFY_NORMALIZABLE;
|
||||
}
|
||||
|
|
@ -1943,7 +1943,7 @@ _nm_connection_verify(NMConnection *connection, GError **error)
|
|||
_("setting is required for non-slave connections"));
|
||||
g_prefix_error(&normalizable_error, "%s: ", NM_SETTING_PROXY_SETTING_NAME);
|
||||
|
||||
/* having a master without proxy config was not a verify() error, accept
|
||||
/* having a controller without proxy config was not a verify() error, accept
|
||||
* it for backward compatibility. */
|
||||
normalizable_error_type = NM_SETTING_VERIFY_NORMALIZABLE;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -87,24 +87,24 @@ verify(NMSetting *setting, NMConnection *connection, GError **error)
|
|||
}
|
||||
|
||||
if (nm_utils_is_uuid(priv->parent)) {
|
||||
/* If we have an NMSettingConnection:master with slave-type="6lowpan",
|
||||
/* If we have an NMSettingConnection:controller with slave-type="6lowpan",
|
||||
* then it must be the same UUID.
|
||||
*/
|
||||
if (s_con) {
|
||||
const char *master = NULL, *slave_type = NULL;
|
||||
const char *controller = NULL, *slave_type = NULL;
|
||||
|
||||
slave_type = nm_setting_connection_get_port_type(s_con);
|
||||
if (!g_strcmp0(slave_type, NM_SETTING_6LOWPAN_SETTING_NAME))
|
||||
master = nm_setting_connection_get_controller(s_con);
|
||||
controller = nm_setting_connection_get_controller(s_con);
|
||||
|
||||
if (master && g_strcmp0(priv->parent, master) != 0) {
|
||||
if (controller && g_strcmp0(priv->parent, controller) != 0) {
|
||||
g_set_error(error,
|
||||
NM_CONNECTION_ERROR,
|
||||
NM_CONNECTION_ERROR_INVALID_PROPERTY,
|
||||
_("'%s' value doesn't match '%s=%s'"),
|
||||
priv->parent,
|
||||
NM_SETTING_CONNECTION_CONTROLLER,
|
||||
master);
|
||||
controller);
|
||||
g_prefix_error(error,
|
||||
"%s.%s: ",
|
||||
NM_SETTING_6LOWPAN_SETTING_NAME,
|
||||
|
|
|
|||
|
|
@ -712,7 +712,7 @@ nm_setting_connection_get_zone(NMSettingConnection *setting)
|
|||
*
|
||||
* Returns the #NMSettingConnection:master property of the connection.
|
||||
*
|
||||
* Returns: interface name of the master device or UUID of the master
|
||||
* Returns: interface name of the controller device or UUID of the controller
|
||||
* connection.
|
||||
*
|
||||
* Deprecated: 1.46. Use nm_setting_connection_get_master() instead which
|
||||
|
|
@ -2531,14 +2531,14 @@ nm_setting_connection_class_init(NMSettingConnectionClass *klass)
|
|||
/**
|
||||
* NMSettingConnection:master:
|
||||
*
|
||||
* Interface name of the master device or UUID of the master connection.
|
||||
* Interface name of the controller device or UUID of the controller connection.
|
||||
*
|
||||
* Deprecated 1.46. Use #NMSettingConnection:controller instead, this is just an alias.
|
||||
**/
|
||||
/* ---ifcfg-rh---
|
||||
* property: master
|
||||
* variable: MASTER, MASTER_UUID, TEAM_MASTER, TEAM_MASTER_UUID, BRIDGE, BRIDGE_UUID
|
||||
* description: Reference to master connection. The variable used depends on
|
||||
* description: Reference to controller connection. The variable used depends on
|
||||
* the connection type and the value. In general, if the *_UUID variant is present,
|
||||
* the variant without *_UUID is ignored. NetworkManager attempts to write both
|
||||
* for compatibility with legacy tooling.
|
||||
|
|
@ -2589,7 +2589,7 @@ nm_setting_connection_class_init(NMSettingConnectionClass *klass)
|
|||
/**
|
||||
* NMSettingConnection:slave-type:
|
||||
*
|
||||
* Setting name of the device type of this slave's master connection (eg,
|
||||
* Setting name of the device type of this slave's controller connection (eg,
|
||||
* %NM_SETTING_BOND_SETTING_NAME), or %NULL if this connection is not a
|
||||
* slave.
|
||||
*
|
||||
|
|
@ -2657,7 +2657,7 @@ nm_setting_connection_class_init(NMSettingConnectionClass *klass)
|
|||
*
|
||||
* Whether or not slaves of this connection should be automatically brought up
|
||||
* when NetworkManager activates this connection. This only has a real effect
|
||||
* for master connections. The properties #NMSettingConnection:autoconnect,
|
||||
* for controller connections. The properties #NMSettingConnection:autoconnect,
|
||||
* #NMSettingConnection:autoconnect-priority and #NMSettingConnection:autoconnect-retries
|
||||
* are unrelated to this setting.
|
||||
* The permitted values are: 0: leave slave connections untouched,
|
||||
|
|
|
|||
|
|
@ -316,24 +316,24 @@ verify(NMSetting *setting, NMConnection *connection, GError **error)
|
|||
|
||||
if (priv->parent) {
|
||||
if (nm_utils_is_uuid(priv->parent)) {
|
||||
/* If we have an NMSettingConnection:master with slave-type="macsec",
|
||||
/* If we have an NMSettingConnection:controller with slave-type="macsec",
|
||||
* then it must be the same UUID.
|
||||
*/
|
||||
if (s_con) {
|
||||
const char *master = NULL, *slave_type = NULL;
|
||||
const char *controller = NULL, *slave_type = NULL;
|
||||
|
||||
slave_type = nm_setting_connection_get_port_type(s_con);
|
||||
if (!g_strcmp0(slave_type, NM_SETTING_MACSEC_SETTING_NAME))
|
||||
master = nm_setting_connection_get_controller(s_con);
|
||||
controller = nm_setting_connection_get_controller(s_con);
|
||||
|
||||
if (master && g_strcmp0(priv->parent, master) != 0) {
|
||||
if (controller && g_strcmp0(priv->parent, controller) != 0) {
|
||||
g_set_error(error,
|
||||
NM_CONNECTION_ERROR,
|
||||
NM_CONNECTION_ERROR_INVALID_PROPERTY,
|
||||
_("'%s' value doesn't match '%s=%s'"),
|
||||
priv->parent,
|
||||
NM_SETTING_CONNECTION_CONTROLLER,
|
||||
master);
|
||||
controller);
|
||||
g_prefix_error(error,
|
||||
"%s.%s: ",
|
||||
NM_SETTING_MACSEC_SETTING_NAME,
|
||||
|
|
|
|||
|
|
@ -157,7 +157,7 @@ verify(NMSetting *setting, NMConnection *connection, GError **error)
|
|||
g_set_error(error,
|
||||
NM_CONNECTION_ERROR,
|
||||
NM_CONNECTION_ERROR_INVALID_PROPERTY,
|
||||
_("A connection with a '%s' setting must not have a master."),
|
||||
_("A connection with a '%s' setting must not have a controller."),
|
||||
NM_SETTING_OVS_BRIDGE_SETTING_NAME);
|
||||
g_prefix_error(error,
|
||||
"%s.%s: ",
|
||||
|
|
|
|||
|
|
@ -417,7 +417,7 @@ verify(NMSetting *setting, NMConnection *connection, GError **error)
|
|||
g_set_error(error,
|
||||
NM_CONNECTION_ERROR,
|
||||
NM_CONNECTION_ERROR_INVALID_PROPERTY,
|
||||
_("A connection with a '%s' setting must have a master."),
|
||||
_("A connection with a '%s' setting must have a controller."),
|
||||
NM_SETTING_OVS_PORT_SETTING_NAME);
|
||||
g_prefix_error(error,
|
||||
"%s.%s: ",
|
||||
|
|
|
|||
|
|
@ -727,7 +727,7 @@ nm_team_link_watcher_get_flags(const NMTeamLinkWatcher *watcher)
|
|||
|
||||
/*****************************************************************************/
|
||||
|
||||
static GParamSpec *obj_properties[_NM_TEAM_ATTRIBUTE_MASTER_NUM] = {
|
||||
static GParamSpec *obj_properties[_NM_TEAM_ATTRIBUTE_CONTROLLER_NUM] = {
|
||||
NULL,
|
||||
};
|
||||
|
||||
|
|
@ -804,7 +804,7 @@ nm_setting_team_get_notify_peers_count(NMSettingTeam *setting)
|
|||
{
|
||||
g_return_val_if_fail(NM_IS_SETTING_TEAM(setting), 0);
|
||||
|
||||
return NM_SETTING_TEAM_GET_PRIVATE(setting)->team_setting->d.master.notify_peers_count;
|
||||
return NM_SETTING_TEAM_GET_PRIVATE(setting)->team_setting->d.controller.notify_peers_count;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -820,7 +820,7 @@ nm_setting_team_get_notify_peers_interval(NMSettingTeam *setting)
|
|||
{
|
||||
g_return_val_if_fail(NM_IS_SETTING_TEAM(setting), 0);
|
||||
|
||||
return NM_SETTING_TEAM_GET_PRIVATE(setting)->team_setting->d.master.notify_peers_interval;
|
||||
return NM_SETTING_TEAM_GET_PRIVATE(setting)->team_setting->d.controller.notify_peers_interval;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -836,7 +836,7 @@ nm_setting_team_get_mcast_rejoin_count(NMSettingTeam *setting)
|
|||
{
|
||||
g_return_val_if_fail(NM_IS_SETTING_TEAM(setting), 0);
|
||||
|
||||
return NM_SETTING_TEAM_GET_PRIVATE(setting)->team_setting->d.master.mcast_rejoin_count;
|
||||
return NM_SETTING_TEAM_GET_PRIVATE(setting)->team_setting->d.controller.mcast_rejoin_count;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -852,7 +852,7 @@ nm_setting_team_get_mcast_rejoin_interval(NMSettingTeam *setting)
|
|||
{
|
||||
g_return_val_if_fail(NM_IS_SETTING_TEAM(setting), 0);
|
||||
|
||||
return NM_SETTING_TEAM_GET_PRIVATE(setting)->team_setting->d.master.mcast_rejoin_interval;
|
||||
return NM_SETTING_TEAM_GET_PRIVATE(setting)->team_setting->d.controller.mcast_rejoin_interval;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -868,7 +868,7 @@ nm_setting_team_get_runner(NMSettingTeam *setting)
|
|||
{
|
||||
g_return_val_if_fail(NM_IS_SETTING_TEAM(setting), NULL);
|
||||
|
||||
return NM_SETTING_TEAM_GET_PRIVATE(setting)->team_setting->d.master.runner;
|
||||
return NM_SETTING_TEAM_GET_PRIVATE(setting)->team_setting->d.controller.runner;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -884,7 +884,7 @@ nm_setting_team_get_runner_hwaddr_policy(NMSettingTeam *setting)
|
|||
{
|
||||
g_return_val_if_fail(NM_IS_SETTING_TEAM(setting), NULL);
|
||||
|
||||
return NM_SETTING_TEAM_GET_PRIVATE(setting)->team_setting->d.master.runner_hwaddr_policy;
|
||||
return NM_SETTING_TEAM_GET_PRIVATE(setting)->team_setting->d.controller.runner_hwaddr_policy;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -900,7 +900,7 @@ nm_setting_team_get_runner_tx_balancer(NMSettingTeam *setting)
|
|||
{
|
||||
g_return_val_if_fail(NM_IS_SETTING_TEAM(setting), NULL);
|
||||
|
||||
return NM_SETTING_TEAM_GET_PRIVATE(setting)->team_setting->d.master.runner_tx_balancer;
|
||||
return NM_SETTING_TEAM_GET_PRIVATE(setting)->team_setting->d.controller.runner_tx_balancer;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -916,7 +916,8 @@ nm_setting_team_get_runner_tx_balancer_interval(NMSettingTeam *setting)
|
|||
{
|
||||
g_return_val_if_fail(NM_IS_SETTING_TEAM(setting), 0);
|
||||
|
||||
return NM_SETTING_TEAM_GET_PRIVATE(setting)->team_setting->d.master.runner_tx_balancer_interval;
|
||||
return NM_SETTING_TEAM_GET_PRIVATE(setting)
|
||||
->team_setting->d.controller.runner_tx_balancer_interval;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -932,7 +933,7 @@ nm_setting_team_get_runner_active(NMSettingTeam *setting)
|
|||
{
|
||||
g_return_val_if_fail(NM_IS_SETTING_TEAM(setting), FALSE);
|
||||
|
||||
return NM_SETTING_TEAM_GET_PRIVATE(setting)->team_setting->d.master.runner_active;
|
||||
return NM_SETTING_TEAM_GET_PRIVATE(setting)->team_setting->d.controller.runner_active;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -948,7 +949,7 @@ nm_setting_team_get_runner_fast_rate(NMSettingTeam *setting)
|
|||
{
|
||||
g_return_val_if_fail(NM_IS_SETTING_TEAM(setting), FALSE);
|
||||
|
||||
return NM_SETTING_TEAM_GET_PRIVATE(setting)->team_setting->d.master.runner_fast_rate;
|
||||
return NM_SETTING_TEAM_GET_PRIVATE(setting)->team_setting->d.controller.runner_fast_rate;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -964,7 +965,7 @@ nm_setting_team_get_runner_sys_prio(NMSettingTeam *setting)
|
|||
{
|
||||
g_return_val_if_fail(NM_IS_SETTING_TEAM(setting), 0);
|
||||
|
||||
return NM_SETTING_TEAM_GET_PRIVATE(setting)->team_setting->d.master.runner_sys_prio;
|
||||
return NM_SETTING_TEAM_GET_PRIVATE(setting)->team_setting->d.controller.runner_sys_prio;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -980,7 +981,7 @@ nm_setting_team_get_runner_min_ports(NMSettingTeam *setting)
|
|||
{
|
||||
g_return_val_if_fail(NM_IS_SETTING_TEAM(setting), 0);
|
||||
|
||||
return NM_SETTING_TEAM_GET_PRIVATE(setting)->team_setting->d.master.runner_min_ports;
|
||||
return NM_SETTING_TEAM_GET_PRIVATE(setting)->team_setting->d.controller.runner_min_ports;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -996,7 +997,8 @@ nm_setting_team_get_runner_agg_select_policy(NMSettingTeam *setting)
|
|||
{
|
||||
g_return_val_if_fail(NM_IS_SETTING_TEAM(setting), NULL);
|
||||
|
||||
return NM_SETTING_TEAM_GET_PRIVATE(setting)->team_setting->d.master.runner_agg_select_policy;
|
||||
return NM_SETTING_TEAM_GET_PRIVATE(setting)
|
||||
->team_setting->d.controller.runner_agg_select_policy;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -1020,13 +1022,13 @@ nm_setting_team_remove_runner_tx_hash_by_value(NMSettingTeam *setting, const cha
|
|||
g_return_val_if_fail(NM_IS_SETTING_TEAM(setting), FALSE);
|
||||
g_return_val_if_fail(txhash != NULL, FALSE);
|
||||
|
||||
arr = priv->team_setting->d.master.runner_tx_hash;
|
||||
arr = priv->team_setting->d.controller.runner_tx_hash;
|
||||
if (arr) {
|
||||
for (i = 0; i < arr->len; i++) {
|
||||
if (nm_streq(txhash, arr->pdata[i])) {
|
||||
_maybe_changed_with_assert(
|
||||
setting,
|
||||
nm_team_setting_value_master_runner_tx_hash_remove(priv->team_setting, i));
|
||||
nm_team_setting_value_controller_runner_tx_hash_remove(priv->team_setting, i));
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
|
@ -1049,7 +1051,7 @@ nm_setting_team_get_num_runner_tx_hash(NMSettingTeam *setting)
|
|||
|
||||
g_return_val_if_fail(NM_IS_SETTING_TEAM(setting), 0);
|
||||
|
||||
arr = NM_SETTING_TEAM_GET_PRIVATE(setting)->team_setting->d.master.runner_tx_hash;
|
||||
arr = NM_SETTING_TEAM_GET_PRIVATE(setting)->team_setting->d.controller.runner_tx_hash;
|
||||
return arr ? arr->len : 0u;
|
||||
}
|
||||
|
||||
|
|
@ -1069,7 +1071,7 @@ nm_setting_team_get_runner_tx_hash(NMSettingTeam *setting, guint idx)
|
|||
|
||||
g_return_val_if_fail(NM_IS_SETTING_TEAM(setting), NULL);
|
||||
|
||||
arr = NM_SETTING_TEAM_GET_PRIVATE(setting)->team_setting->d.master.runner_tx_hash;
|
||||
arr = NM_SETTING_TEAM_GET_PRIVATE(setting)->team_setting->d.controller.runner_tx_hash;
|
||||
|
||||
g_return_val_if_fail(arr, NULL);
|
||||
g_return_val_if_fail(idx < arr->len, NULL);
|
||||
|
|
@ -1095,12 +1097,12 @@ nm_setting_team_remove_runner_tx_hash(NMSettingTeam *setting, guint idx)
|
|||
|
||||
priv = NM_SETTING_TEAM_GET_PRIVATE(setting);
|
||||
|
||||
g_return_if_fail(priv->team_setting->d.master.runner_tx_hash);
|
||||
g_return_if_fail(idx < priv->team_setting->d.master.runner_tx_hash->len);
|
||||
g_return_if_fail(priv->team_setting->d.controller.runner_tx_hash);
|
||||
g_return_if_fail(idx < priv->team_setting->d.controller.runner_tx_hash->len);
|
||||
|
||||
_maybe_changed_with_assert(
|
||||
setting,
|
||||
nm_team_setting_value_master_runner_tx_hash_remove(priv->team_setting, idx));
|
||||
nm_team_setting_value_controller_runner_tx_hash_remove(priv->team_setting, idx));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -1122,7 +1124,7 @@ nm_setting_team_add_runner_tx_hash(NMSettingTeam *setting, const char *txhash)
|
|||
g_return_val_if_fail(txhash, FALSE);
|
||||
|
||||
return _maybe_changed(setting,
|
||||
nm_team_setting_value_master_runner_tx_hash_add(
|
||||
nm_team_setting_value_controller_runner_tx_hash_add(
|
||||
NM_SETTING_TEAM_GET_PRIVATE(setting)->team_setting,
|
||||
txhash));
|
||||
}
|
||||
|
|
@ -1359,27 +1361,27 @@ get_property(GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
|
|||
case NM_TEAM_ATTRIBUTE_CONFIG:
|
||||
g_value_set_string(value, nm_team_setting_config_get(priv->team_setting));
|
||||
break;
|
||||
case NM_TEAM_ATTRIBUTE_MASTER_RUNNER_ACTIVE:
|
||||
case NM_TEAM_ATTRIBUTE_MASTER_RUNNER_FAST_RATE:
|
||||
case NM_TEAM_ATTRIBUTE_CONTROLLER_RUNNER_ACTIVE:
|
||||
case NM_TEAM_ATTRIBUTE_CONTROLLER_RUNNER_FAST_RATE:
|
||||
g_value_set_boolean(value, nm_team_setting_value_get_bool(priv->team_setting, prop_id));
|
||||
break;
|
||||
case NM_TEAM_ATTRIBUTE_MASTER_NOTIFY_PEERS_COUNT:
|
||||
case NM_TEAM_ATTRIBUTE_MASTER_NOTIFY_PEERS_INTERVAL:
|
||||
case NM_TEAM_ATTRIBUTE_MASTER_MCAST_REJOIN_COUNT:
|
||||
case NM_TEAM_ATTRIBUTE_MASTER_MCAST_REJOIN_INTERVAL:
|
||||
case NM_TEAM_ATTRIBUTE_MASTER_RUNNER_TX_BALANCER_INTERVAL:
|
||||
case NM_TEAM_ATTRIBUTE_MASTER_RUNNER_SYS_PRIO:
|
||||
case NM_TEAM_ATTRIBUTE_MASTER_RUNNER_MIN_PORTS:
|
||||
case NM_TEAM_ATTRIBUTE_CONTROLLER_NOTIFY_PEERS_COUNT:
|
||||
case NM_TEAM_ATTRIBUTE_CONTROLLER_NOTIFY_PEERS_INTERVAL:
|
||||
case NM_TEAM_ATTRIBUTE_CONTROLLER_MCAST_REJOIN_COUNT:
|
||||
case NM_TEAM_ATTRIBUTE_CONTROLLER_MCAST_REJOIN_INTERVAL:
|
||||
case NM_TEAM_ATTRIBUTE_CONTROLLER_RUNNER_TX_BALANCER_INTERVAL:
|
||||
case NM_TEAM_ATTRIBUTE_CONTROLLER_RUNNER_SYS_PRIO:
|
||||
case NM_TEAM_ATTRIBUTE_CONTROLLER_RUNNER_MIN_PORTS:
|
||||
g_value_set_int(value, nm_team_setting_value_get_int32(priv->team_setting, prop_id));
|
||||
break;
|
||||
case NM_TEAM_ATTRIBUTE_MASTER_RUNNER:
|
||||
case NM_TEAM_ATTRIBUTE_MASTER_RUNNER_HWADDR_POLICY:
|
||||
case NM_TEAM_ATTRIBUTE_MASTER_RUNNER_TX_BALANCER:
|
||||
case NM_TEAM_ATTRIBUTE_MASTER_RUNNER_AGG_SELECT_POLICY:
|
||||
case NM_TEAM_ATTRIBUTE_CONTROLLER_RUNNER:
|
||||
case NM_TEAM_ATTRIBUTE_CONTROLLER_RUNNER_HWADDR_POLICY:
|
||||
case NM_TEAM_ATTRIBUTE_CONTROLLER_RUNNER_TX_BALANCER:
|
||||
case NM_TEAM_ATTRIBUTE_CONTROLLER_RUNNER_AGG_SELECT_POLICY:
|
||||
g_value_set_string(value, nm_team_setting_value_get_string(priv->team_setting, prop_id));
|
||||
break;
|
||||
case NM_TEAM_ATTRIBUTE_MASTER_RUNNER_TX_HASH:
|
||||
v_ptrarr = priv->team_setting->d.master.runner_tx_hash;
|
||||
case NM_TEAM_ATTRIBUTE_CONTROLLER_RUNNER_TX_HASH:
|
||||
v_ptrarr = priv->team_setting->d.controller.runner_tx_hash;
|
||||
g_value_take_boxed(value, nm_strv_ptrarray_to_strv_full(v_ptrarr, FALSE));
|
||||
break;
|
||||
case NM_TEAM_ATTRIBUTE_LINK_WATCHERS:
|
||||
|
|
@ -1406,32 +1408,32 @@ set_property(GObject *object, guint prop_id, const GValue *value, GParamSpec *ps
|
|||
case NM_TEAM_ATTRIBUTE_CONFIG:
|
||||
changed = nm_team_setting_config_set(priv->team_setting, g_value_get_string(value));
|
||||
break;
|
||||
case NM_TEAM_ATTRIBUTE_MASTER_RUNNER_ACTIVE:
|
||||
case NM_TEAM_ATTRIBUTE_MASTER_RUNNER_FAST_RATE:
|
||||
case NM_TEAM_ATTRIBUTE_CONTROLLER_RUNNER_ACTIVE:
|
||||
case NM_TEAM_ATTRIBUTE_CONTROLLER_RUNNER_FAST_RATE:
|
||||
changed =
|
||||
nm_team_setting_value_set_bool(priv->team_setting, prop_id, g_value_get_boolean(value));
|
||||
break;
|
||||
case NM_TEAM_ATTRIBUTE_MASTER_NOTIFY_PEERS_COUNT:
|
||||
case NM_TEAM_ATTRIBUTE_MASTER_NOTIFY_PEERS_INTERVAL:
|
||||
case NM_TEAM_ATTRIBUTE_MASTER_MCAST_REJOIN_COUNT:
|
||||
case NM_TEAM_ATTRIBUTE_MASTER_MCAST_REJOIN_INTERVAL:
|
||||
case NM_TEAM_ATTRIBUTE_MASTER_RUNNER_TX_BALANCER_INTERVAL:
|
||||
case NM_TEAM_ATTRIBUTE_MASTER_RUNNER_SYS_PRIO:
|
||||
case NM_TEAM_ATTRIBUTE_MASTER_RUNNER_MIN_PORTS:
|
||||
case NM_TEAM_ATTRIBUTE_CONTROLLER_NOTIFY_PEERS_COUNT:
|
||||
case NM_TEAM_ATTRIBUTE_CONTROLLER_NOTIFY_PEERS_INTERVAL:
|
||||
case NM_TEAM_ATTRIBUTE_CONTROLLER_MCAST_REJOIN_COUNT:
|
||||
case NM_TEAM_ATTRIBUTE_CONTROLLER_MCAST_REJOIN_INTERVAL:
|
||||
case NM_TEAM_ATTRIBUTE_CONTROLLER_RUNNER_TX_BALANCER_INTERVAL:
|
||||
case NM_TEAM_ATTRIBUTE_CONTROLLER_RUNNER_SYS_PRIO:
|
||||
case NM_TEAM_ATTRIBUTE_CONTROLLER_RUNNER_MIN_PORTS:
|
||||
changed =
|
||||
nm_team_setting_value_set_int32(priv->team_setting, prop_id, g_value_get_int(value));
|
||||
break;
|
||||
case NM_TEAM_ATTRIBUTE_MASTER_RUNNER:
|
||||
case NM_TEAM_ATTRIBUTE_MASTER_RUNNER_TX_BALANCER:
|
||||
case NM_TEAM_ATTRIBUTE_MASTER_RUNNER_HWADDR_POLICY:
|
||||
case NM_TEAM_ATTRIBUTE_MASTER_RUNNER_AGG_SELECT_POLICY:
|
||||
case NM_TEAM_ATTRIBUTE_CONTROLLER_RUNNER:
|
||||
case NM_TEAM_ATTRIBUTE_CONTROLLER_RUNNER_TX_BALANCER:
|
||||
case NM_TEAM_ATTRIBUTE_CONTROLLER_RUNNER_HWADDR_POLICY:
|
||||
case NM_TEAM_ATTRIBUTE_CONTROLLER_RUNNER_AGG_SELECT_POLICY:
|
||||
changed = nm_team_setting_value_set_string(priv->team_setting,
|
||||
prop_id,
|
||||
g_value_get_string(value));
|
||||
break;
|
||||
case NM_TEAM_ATTRIBUTE_MASTER_RUNNER_TX_HASH:
|
||||
case NM_TEAM_ATTRIBUTE_CONTROLLER_RUNNER_TX_HASH:
|
||||
v_ptrarr = g_value_get_boxed(value);
|
||||
changed = nm_team_setting_value_master_runner_tx_hash_set_list(
|
||||
changed = nm_team_setting_value_controller_runner_tx_hash_set_list(
|
||||
priv->team_setting,
|
||||
v_ptrarr ? (const char *const *) v_ptrarr->pdata : NULL,
|
||||
v_ptrarr ? v_ptrarr->len : 0u);
|
||||
|
|
@ -1535,7 +1537,7 @@ nm_setting_team_class_init(NMSettingTeamClass *klass)
|
|||
*
|
||||
* Since: 1.12
|
||||
**/
|
||||
obj_properties[NM_TEAM_ATTRIBUTE_MASTER_NOTIFY_PEERS_COUNT] =
|
||||
obj_properties[NM_TEAM_ATTRIBUTE_CONTROLLER_NOTIFY_PEERS_COUNT] =
|
||||
g_param_spec_int(NM_SETTING_TEAM_NOTIFY_PEERS_COUNT,
|
||||
"",
|
||||
"",
|
||||
|
|
@ -1544,7 +1546,7 @@ nm_setting_team_class_init(NMSettingTeamClass *klass)
|
|||
-1,
|
||||
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
|
||||
_nm_properties_override_gobj(properties_override,
|
||||
obj_properties[NM_TEAM_ATTRIBUTE_MASTER_NOTIFY_PEERS_COUNT],
|
||||
obj_properties[NM_TEAM_ATTRIBUTE_CONTROLLER_NOTIFY_PEERS_COUNT],
|
||||
&nm_sett_info_propert_type_team_i);
|
||||
|
||||
/**
|
||||
|
|
@ -1554,7 +1556,7 @@ nm_setting_team_class_init(NMSettingTeamClass *klass)
|
|||
*
|
||||
* Since: 1.12
|
||||
**/
|
||||
obj_properties[NM_TEAM_ATTRIBUTE_MASTER_NOTIFY_PEERS_INTERVAL] =
|
||||
obj_properties[NM_TEAM_ATTRIBUTE_CONTROLLER_NOTIFY_PEERS_INTERVAL] =
|
||||
g_param_spec_int(NM_SETTING_TEAM_NOTIFY_PEERS_INTERVAL,
|
||||
"",
|
||||
"",
|
||||
|
|
@ -1563,7 +1565,7 @@ nm_setting_team_class_init(NMSettingTeamClass *klass)
|
|||
-1,
|
||||
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
|
||||
_nm_properties_override_gobj(properties_override,
|
||||
obj_properties[NM_TEAM_ATTRIBUTE_MASTER_NOTIFY_PEERS_INTERVAL],
|
||||
obj_properties[NM_TEAM_ATTRIBUTE_CONTROLLER_NOTIFY_PEERS_INTERVAL],
|
||||
&nm_sett_info_propert_type_team_i);
|
||||
|
||||
/**
|
||||
|
|
@ -1573,7 +1575,7 @@ nm_setting_team_class_init(NMSettingTeamClass *klass)
|
|||
*
|
||||
* Since: 1.12
|
||||
**/
|
||||
obj_properties[NM_TEAM_ATTRIBUTE_MASTER_MCAST_REJOIN_COUNT] =
|
||||
obj_properties[NM_TEAM_ATTRIBUTE_CONTROLLER_MCAST_REJOIN_COUNT] =
|
||||
g_param_spec_int(NM_SETTING_TEAM_MCAST_REJOIN_COUNT,
|
||||
"",
|
||||
"",
|
||||
|
|
@ -1582,7 +1584,7 @@ nm_setting_team_class_init(NMSettingTeamClass *klass)
|
|||
-1,
|
||||
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
|
||||
_nm_properties_override_gobj(properties_override,
|
||||
obj_properties[NM_TEAM_ATTRIBUTE_MASTER_MCAST_REJOIN_COUNT],
|
||||
obj_properties[NM_TEAM_ATTRIBUTE_CONTROLLER_MCAST_REJOIN_COUNT],
|
||||
&nm_sett_info_propert_type_team_i);
|
||||
|
||||
/**
|
||||
|
|
@ -1592,7 +1594,7 @@ nm_setting_team_class_init(NMSettingTeamClass *klass)
|
|||
*
|
||||
* Since: 1.12
|
||||
**/
|
||||
obj_properties[NM_TEAM_ATTRIBUTE_MASTER_MCAST_REJOIN_INTERVAL] =
|
||||
obj_properties[NM_TEAM_ATTRIBUTE_CONTROLLER_MCAST_REJOIN_INTERVAL] =
|
||||
g_param_spec_int(NM_SETTING_TEAM_MCAST_REJOIN_INTERVAL,
|
||||
"",
|
||||
"",
|
||||
|
|
@ -1601,7 +1603,7 @@ nm_setting_team_class_init(NMSettingTeamClass *klass)
|
|||
-1,
|
||||
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
|
||||
_nm_properties_override_gobj(properties_override,
|
||||
obj_properties[NM_TEAM_ATTRIBUTE_MASTER_MCAST_REJOIN_INTERVAL],
|
||||
obj_properties[NM_TEAM_ATTRIBUTE_CONTROLLER_MCAST_REJOIN_INTERVAL],
|
||||
&nm_sett_info_propert_type_team_i);
|
||||
|
||||
/**
|
||||
|
|
@ -1613,14 +1615,14 @@ nm_setting_team_class_init(NMSettingTeamClass *klass)
|
|||
*
|
||||
* Since: 1.12
|
||||
**/
|
||||
obj_properties[NM_TEAM_ATTRIBUTE_MASTER_RUNNER] =
|
||||
obj_properties[NM_TEAM_ATTRIBUTE_CONTROLLER_RUNNER] =
|
||||
g_param_spec_string(NM_SETTING_TEAM_RUNNER,
|
||||
"",
|
||||
"",
|
||||
NULL,
|
||||
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
|
||||
_nm_properties_override_gobj(properties_override,
|
||||
obj_properties[NM_TEAM_ATTRIBUTE_MASTER_RUNNER],
|
||||
obj_properties[NM_TEAM_ATTRIBUTE_CONTROLLER_RUNNER],
|
||||
&nm_sett_info_propert_type_team_s);
|
||||
|
||||
/**
|
||||
|
|
@ -1630,14 +1632,14 @@ nm_setting_team_class_init(NMSettingTeamClass *klass)
|
|||
*
|
||||
* Since: 1.12
|
||||
**/
|
||||
obj_properties[NM_TEAM_ATTRIBUTE_MASTER_RUNNER_HWADDR_POLICY] =
|
||||
obj_properties[NM_TEAM_ATTRIBUTE_CONTROLLER_RUNNER_HWADDR_POLICY] =
|
||||
g_param_spec_string(NM_SETTING_TEAM_RUNNER_HWADDR_POLICY,
|
||||
"",
|
||||
"",
|
||||
NULL,
|
||||
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
|
||||
_nm_properties_override_gobj(properties_override,
|
||||
obj_properties[NM_TEAM_ATTRIBUTE_MASTER_RUNNER_HWADDR_POLICY],
|
||||
obj_properties[NM_TEAM_ATTRIBUTE_CONTROLLER_RUNNER_HWADDR_POLICY],
|
||||
&nm_sett_info_propert_type_team_s);
|
||||
|
||||
/**
|
||||
|
|
@ -1647,14 +1649,14 @@ nm_setting_team_class_init(NMSettingTeamClass *klass)
|
|||
*
|
||||
* Since: 1.12
|
||||
**/
|
||||
obj_properties[NM_TEAM_ATTRIBUTE_MASTER_RUNNER_TX_HASH] = g_param_spec_boxed(
|
||||
obj_properties[NM_TEAM_ATTRIBUTE_CONTROLLER_RUNNER_TX_HASH] = g_param_spec_boxed(
|
||||
NM_SETTING_TEAM_RUNNER_TX_HASH,
|
||||
"",
|
||||
"",
|
||||
G_TYPE_STRV,
|
||||
G_PARAM_READWRITE | NM_SETTING_PARAM_INFERRABLE | G_PARAM_STATIC_STRINGS);
|
||||
_nm_properties_override_gobj(properties_override,
|
||||
obj_properties[NM_TEAM_ATTRIBUTE_MASTER_RUNNER_TX_HASH],
|
||||
obj_properties[NM_TEAM_ATTRIBUTE_CONTROLLER_RUNNER_TX_HASH],
|
||||
&nm_sett_info_propert_type_team_as);
|
||||
|
||||
/**
|
||||
|
|
@ -1664,14 +1666,14 @@ nm_setting_team_class_init(NMSettingTeamClass *klass)
|
|||
*
|
||||
* Since: 1.12
|
||||
**/
|
||||
obj_properties[NM_TEAM_ATTRIBUTE_MASTER_RUNNER_TX_BALANCER] =
|
||||
obj_properties[NM_TEAM_ATTRIBUTE_CONTROLLER_RUNNER_TX_BALANCER] =
|
||||
g_param_spec_string(NM_SETTING_TEAM_RUNNER_TX_BALANCER,
|
||||
"",
|
||||
"",
|
||||
NULL,
|
||||
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
|
||||
_nm_properties_override_gobj(properties_override,
|
||||
obj_properties[NM_TEAM_ATTRIBUTE_MASTER_RUNNER_TX_BALANCER],
|
||||
obj_properties[NM_TEAM_ATTRIBUTE_CONTROLLER_RUNNER_TX_BALANCER],
|
||||
&nm_sett_info_propert_type_team_s);
|
||||
|
||||
/**
|
||||
|
|
@ -1681,7 +1683,7 @@ nm_setting_team_class_init(NMSettingTeamClass *klass)
|
|||
*
|
||||
* Since: 1.12
|
||||
**/
|
||||
obj_properties[NM_TEAM_ATTRIBUTE_MASTER_RUNNER_TX_BALANCER_INTERVAL] =
|
||||
obj_properties[NM_TEAM_ATTRIBUTE_CONTROLLER_RUNNER_TX_BALANCER_INTERVAL] =
|
||||
g_param_spec_int(NM_SETTING_TEAM_RUNNER_TX_BALANCER_INTERVAL,
|
||||
"",
|
||||
"",
|
||||
|
|
@ -1691,7 +1693,7 @@ nm_setting_team_class_init(NMSettingTeamClass *klass)
|
|||
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
|
||||
_nm_properties_override_gobj(
|
||||
properties_override,
|
||||
obj_properties[NM_TEAM_ATTRIBUTE_MASTER_RUNNER_TX_BALANCER_INTERVAL],
|
||||
obj_properties[NM_TEAM_ATTRIBUTE_CONTROLLER_RUNNER_TX_BALANCER_INTERVAL],
|
||||
&nm_sett_info_propert_type_team_i);
|
||||
|
||||
/**
|
||||
|
|
@ -1701,14 +1703,14 @@ nm_setting_team_class_init(NMSettingTeamClass *klass)
|
|||
*
|
||||
* Since: 1.12
|
||||
**/
|
||||
obj_properties[NM_TEAM_ATTRIBUTE_MASTER_RUNNER_ACTIVE] =
|
||||
obj_properties[NM_TEAM_ATTRIBUTE_CONTROLLER_RUNNER_ACTIVE] =
|
||||
g_param_spec_boolean(NM_SETTING_TEAM_RUNNER_ACTIVE,
|
||||
"",
|
||||
"",
|
||||
TRUE,
|
||||
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
|
||||
_nm_properties_override_gobj(properties_override,
|
||||
obj_properties[NM_TEAM_ATTRIBUTE_MASTER_RUNNER_ACTIVE],
|
||||
obj_properties[NM_TEAM_ATTRIBUTE_CONTROLLER_RUNNER_ACTIVE],
|
||||
&nm_sett_info_propert_type_team_b);
|
||||
|
||||
/**
|
||||
|
|
@ -1718,14 +1720,14 @@ nm_setting_team_class_init(NMSettingTeamClass *klass)
|
|||
*
|
||||
* Since: 1.12
|
||||
**/
|
||||
obj_properties[NM_TEAM_ATTRIBUTE_MASTER_RUNNER_FAST_RATE] =
|
||||
obj_properties[NM_TEAM_ATTRIBUTE_CONTROLLER_RUNNER_FAST_RATE] =
|
||||
g_param_spec_boolean(NM_SETTING_TEAM_RUNNER_FAST_RATE,
|
||||
"",
|
||||
"",
|
||||
FALSE,
|
||||
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
|
||||
_nm_properties_override_gobj(properties_override,
|
||||
obj_properties[NM_TEAM_ATTRIBUTE_MASTER_RUNNER_FAST_RATE],
|
||||
obj_properties[NM_TEAM_ATTRIBUTE_CONTROLLER_RUNNER_FAST_RATE],
|
||||
&nm_sett_info_propert_type_team_b);
|
||||
|
||||
/**
|
||||
|
|
@ -1735,7 +1737,7 @@ nm_setting_team_class_init(NMSettingTeamClass *klass)
|
|||
*
|
||||
* Since: 1.12
|
||||
**/
|
||||
obj_properties[NM_TEAM_ATTRIBUTE_MASTER_RUNNER_SYS_PRIO] =
|
||||
obj_properties[NM_TEAM_ATTRIBUTE_CONTROLLER_RUNNER_SYS_PRIO] =
|
||||
g_param_spec_int(NM_SETTING_TEAM_RUNNER_SYS_PRIO,
|
||||
"",
|
||||
"",
|
||||
|
|
@ -1744,7 +1746,7 @@ nm_setting_team_class_init(NMSettingTeamClass *klass)
|
|||
-1,
|
||||
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
|
||||
_nm_properties_override_gobj(properties_override,
|
||||
obj_properties[NM_TEAM_ATTRIBUTE_MASTER_RUNNER_SYS_PRIO],
|
||||
obj_properties[NM_TEAM_ATTRIBUTE_CONTROLLER_RUNNER_SYS_PRIO],
|
||||
&nm_sett_info_propert_type_team_i);
|
||||
|
||||
/**
|
||||
|
|
@ -1754,7 +1756,7 @@ nm_setting_team_class_init(NMSettingTeamClass *klass)
|
|||
*
|
||||
* Since: 1.12
|
||||
**/
|
||||
obj_properties[NM_TEAM_ATTRIBUTE_MASTER_RUNNER_MIN_PORTS] =
|
||||
obj_properties[NM_TEAM_ATTRIBUTE_CONTROLLER_RUNNER_MIN_PORTS] =
|
||||
g_param_spec_int(NM_SETTING_TEAM_RUNNER_MIN_PORTS,
|
||||
"",
|
||||
"",
|
||||
|
|
@ -1763,7 +1765,7 @@ nm_setting_team_class_init(NMSettingTeamClass *klass)
|
|||
-1,
|
||||
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
|
||||
_nm_properties_override_gobj(properties_override,
|
||||
obj_properties[NM_TEAM_ATTRIBUTE_MASTER_RUNNER_MIN_PORTS],
|
||||
obj_properties[NM_TEAM_ATTRIBUTE_CONTROLLER_RUNNER_MIN_PORTS],
|
||||
&nm_sett_info_propert_type_team_i);
|
||||
|
||||
/**
|
||||
|
|
@ -1773,14 +1775,14 @@ nm_setting_team_class_init(NMSettingTeamClass *klass)
|
|||
*
|
||||
* Since: 1.12
|
||||
**/
|
||||
obj_properties[NM_TEAM_ATTRIBUTE_MASTER_RUNNER_AGG_SELECT_POLICY] =
|
||||
obj_properties[NM_TEAM_ATTRIBUTE_CONTROLLER_RUNNER_AGG_SELECT_POLICY] =
|
||||
g_param_spec_string(NM_SETTING_TEAM_RUNNER_AGG_SELECT_POLICY,
|
||||
"",
|
||||
"",
|
||||
NULL,
|
||||
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
|
||||
_nm_properties_override_gobj(properties_override,
|
||||
obj_properties[NM_TEAM_ATTRIBUTE_MASTER_RUNNER_AGG_SELECT_POLICY],
|
||||
obj_properties[NM_TEAM_ATTRIBUTE_CONTROLLER_RUNNER_AGG_SELECT_POLICY],
|
||||
&nm_sett_info_propert_type_team_s);
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -608,24 +608,24 @@ verify(NMSetting *setting, NMConnection *connection, GError **error)
|
|||
|
||||
if (priv->parent) {
|
||||
if (nm_utils_is_uuid(priv->parent)) {
|
||||
/* If we have an NMSettingConnection:master with slave-type="vlan",
|
||||
/* If we have an NMSettingConnection:controller with slave-type="vlan",
|
||||
* then it must be the same UUID.
|
||||
*/
|
||||
if (s_con) {
|
||||
const char *master = NULL, *slave_type = NULL;
|
||||
const char *controller = NULL, *slave_type = NULL;
|
||||
|
||||
slave_type = nm_setting_connection_get_port_type(s_con);
|
||||
if (!g_strcmp0(slave_type, NM_SETTING_VLAN_SETTING_NAME))
|
||||
master = nm_setting_connection_get_controller(s_con);
|
||||
controller = nm_setting_connection_get_controller(s_con);
|
||||
|
||||
if (master && g_strcmp0(priv->parent, master) != 0) {
|
||||
if (controller && g_strcmp0(priv->parent, controller) != 0) {
|
||||
g_set_error(error,
|
||||
NM_CONNECTION_ERROR,
|
||||
NM_CONNECTION_ERROR_INVALID_PROPERTY,
|
||||
_("'%s' value doesn't match '%s=%s'"),
|
||||
priv->parent,
|
||||
NM_SETTING_CONNECTION_CONTROLLER,
|
||||
master);
|
||||
controller);
|
||||
g_prefix_error(error,
|
||||
"%s.%s: ",
|
||||
NM_SETTING_VLAN_SETTING_NAME,
|
||||
|
|
@ -908,7 +908,7 @@ nm_setting_vlan_class_init(NMSettingVlanClass *klass)
|
|||
* interface. Flags include %NM_VLAN_FLAG_REORDER_HEADERS (reordering of
|
||||
* output packet headers), %NM_VLAN_FLAG_GVRP (use of the GVRP protocol),
|
||||
* and %NM_VLAN_FLAG_LOOSE_BINDING (loose binding of the interface to its
|
||||
* master device's operating state). %NM_VLAN_FLAG_MVRP (use of the MVRP
|
||||
* controller device's operating state). %NM_VLAN_FLAG_MVRP (use of the MVRP
|
||||
* protocol).
|
||||
*
|
||||
* The default value of this property is NM_VLAN_FLAG_REORDER_HEADERS,
|
||||
|
|
|
|||
|
|
@ -94,39 +94,39 @@ typedef struct {
|
|||
|
||||
static const RunnerCompatElem _runner_compat_lst[] = {
|
||||
{
|
||||
NM_TEAM_ATTRIBUTE_MASTER_RUNNER_HWADDR_POLICY,
|
||||
NM_TEAM_ATTRIBUTE_CONTROLLER_RUNNER_HWADDR_POLICY,
|
||||
NM_MAKE_STRV(NM_SETTING_TEAM_RUNNER_ACTIVEBACKUP),
|
||||
},
|
||||
{
|
||||
NM_TEAM_ATTRIBUTE_MASTER_RUNNER_TX_HASH,
|
||||
NM_TEAM_ATTRIBUTE_CONTROLLER_RUNNER_TX_HASH,
|
||||
NM_MAKE_STRV(NM_SETTING_TEAM_RUNNER_LOADBALANCE, NM_SETTING_TEAM_RUNNER_LACP),
|
||||
},
|
||||
{
|
||||
NM_TEAM_ATTRIBUTE_MASTER_RUNNER_TX_BALANCER,
|
||||
NM_TEAM_ATTRIBUTE_CONTROLLER_RUNNER_TX_BALANCER,
|
||||
NM_MAKE_STRV(NM_SETTING_TEAM_RUNNER_LOADBALANCE, NM_SETTING_TEAM_RUNNER_LACP),
|
||||
},
|
||||
{
|
||||
NM_TEAM_ATTRIBUTE_MASTER_RUNNER_TX_BALANCER_INTERVAL,
|
||||
NM_TEAM_ATTRIBUTE_CONTROLLER_RUNNER_TX_BALANCER_INTERVAL,
|
||||
NM_MAKE_STRV(NM_SETTING_TEAM_RUNNER_LOADBALANCE, NM_SETTING_TEAM_RUNNER_LACP),
|
||||
},
|
||||
{
|
||||
NM_TEAM_ATTRIBUTE_MASTER_RUNNER_ACTIVE,
|
||||
NM_TEAM_ATTRIBUTE_CONTROLLER_RUNNER_ACTIVE,
|
||||
NM_MAKE_STRV(NM_SETTING_TEAM_RUNNER_LACP),
|
||||
},
|
||||
{
|
||||
NM_TEAM_ATTRIBUTE_MASTER_RUNNER_FAST_RATE,
|
||||
NM_TEAM_ATTRIBUTE_CONTROLLER_RUNNER_FAST_RATE,
|
||||
NM_MAKE_STRV(NM_SETTING_TEAM_RUNNER_LACP),
|
||||
},
|
||||
{
|
||||
NM_TEAM_ATTRIBUTE_MASTER_RUNNER_SYS_PRIO,
|
||||
NM_TEAM_ATTRIBUTE_CONTROLLER_RUNNER_SYS_PRIO,
|
||||
NM_MAKE_STRV(NM_SETTING_TEAM_RUNNER_LACP),
|
||||
},
|
||||
{
|
||||
NM_TEAM_ATTRIBUTE_MASTER_RUNNER_MIN_PORTS,
|
||||
NM_TEAM_ATTRIBUTE_CONTROLLER_RUNNER_MIN_PORTS,
|
||||
NM_MAKE_STRV(NM_SETTING_TEAM_RUNNER_LACP),
|
||||
},
|
||||
{
|
||||
NM_TEAM_ATTRIBUTE_MASTER_RUNNER_AGG_SELECT_POLICY,
|
||||
NM_TEAM_ATTRIBUTE_CONTROLLER_RUNNER_AGG_SELECT_POLICY,
|
||||
NM_MAKE_STRV(NM_SETTING_TEAM_RUNNER_LACP),
|
||||
},
|
||||
};
|
||||
|
|
@ -148,7 +148,7 @@ typedef struct {
|
|||
NMValueType value_type;
|
||||
guint8 field_offset;
|
||||
guint8 js_keys_len;
|
||||
bool for_master : 1;
|
||||
bool for_controller : 1;
|
||||
bool for_port : 1;
|
||||
bool has_range : 1;
|
||||
} TeamAttrData;
|
||||
|
|
@ -156,7 +156,7 @@ typedef struct {
|
|||
#define TEAM_ATTR_IDX(_is_port, _team_attr) \
|
||||
(((!(_is_port) || (_team_attr) < _NM_TEAM_ATTRIBUTE_START) \
|
||||
? (int) (_team_attr) \
|
||||
: (((int) (_NM_TEAM_ATTRIBUTE_MASTER_NUM - _NM_TEAM_ATTRIBUTE_START)) \
|
||||
: (((int) (_NM_TEAM_ATTRIBUTE_CONTROLLER_NUM - _NM_TEAM_ATTRIBUTE_START)) \
|
||||
+ ((int) (_team_attr)))) \
|
||||
- 1)
|
||||
|
||||
|
|
@ -187,15 +187,15 @@ static const TeamAttrData team_attr_datas[] = {
|
|||
|
||||
#define _VAL_UNSPEC() .default_val.v_string = (NULL)
|
||||
|
||||
#define _INIT(_is_port, _team_attr, field, _value_type, _property_name, ...) \
|
||||
[TEAM_ATTR_IDX(_is_port, _team_attr)] = { \
|
||||
.for_master = (_team_attr) < _NM_TEAM_ATTRIBUTE_START || !(_is_port), \
|
||||
.for_port = (_team_attr) < _NM_TEAM_ATTRIBUTE_START || (_is_port), \
|
||||
.team_attr = (_team_attr), \
|
||||
.field_offset = G_STRUCT_OFFSET(NMTeamSetting, _data_priv.field), \
|
||||
.value_type = (_value_type), \
|
||||
.property_name = ""_property_name \
|
||||
"", \
|
||||
#define _INIT(_is_port, _team_attr, field, _value_type, _property_name, ...) \
|
||||
[TEAM_ATTR_IDX(_is_port, _team_attr)] = { \
|
||||
.for_controller = (_team_attr) < _NM_TEAM_ATTRIBUTE_START || !(_is_port), \
|
||||
.for_port = (_team_attr) < _NM_TEAM_ATTRIBUTE_START || (_is_port), \
|
||||
.team_attr = (_team_attr), \
|
||||
.field_offset = G_STRUCT_OFFSET(NMTeamSetting, _data_priv.field), \
|
||||
.value_type = (_value_type), \
|
||||
.property_name = ""_property_name \
|
||||
"", \
|
||||
__VA_ARGS__}
|
||||
|
||||
_INIT(0, NM_TEAM_ATTRIBUTE_CONFIG, _js_str, NM_VALUE_TYPE_UNSPEC, NM_SETTING_TEAM_CONFIG, ),
|
||||
|
|
@ -209,99 +209,99 @@ static const TeamAttrData team_attr_datas[] = {
|
|||
_VAL_UNSPEC(), ),
|
||||
|
||||
_INIT(0,
|
||||
NM_TEAM_ATTRIBUTE_MASTER_NOTIFY_PEERS_COUNT,
|
||||
master.notify_peers_count,
|
||||
NM_TEAM_ATTRIBUTE_CONTROLLER_NOTIFY_PEERS_COUNT,
|
||||
controller.notify_peers_count,
|
||||
NM_VALUE_TYPE_INT32,
|
||||
NM_SETTING_TEAM_NOTIFY_PEERS_COUNT,
|
||||
_JS_KEYS("notify_peers", "count"),
|
||||
_VAL_INT32_RANGE(-1, 0, G_MAXINT32), ),
|
||||
_INIT(0,
|
||||
NM_TEAM_ATTRIBUTE_MASTER_NOTIFY_PEERS_INTERVAL,
|
||||
master.notify_peers_interval,
|
||||
NM_TEAM_ATTRIBUTE_CONTROLLER_NOTIFY_PEERS_INTERVAL,
|
||||
controller.notify_peers_interval,
|
||||
NM_VALUE_TYPE_INT32,
|
||||
NM_SETTING_TEAM_NOTIFY_PEERS_INTERVAL,
|
||||
_JS_KEYS("notify_peers", "interval"),
|
||||
_VAL_INT32_RANGE(-1, 0, G_MAXINT32), ),
|
||||
_INIT(0,
|
||||
NM_TEAM_ATTRIBUTE_MASTER_MCAST_REJOIN_COUNT,
|
||||
master.mcast_rejoin_count,
|
||||
NM_TEAM_ATTRIBUTE_CONTROLLER_MCAST_REJOIN_COUNT,
|
||||
controller.mcast_rejoin_count,
|
||||
NM_VALUE_TYPE_INT32,
|
||||
NM_SETTING_TEAM_MCAST_REJOIN_COUNT,
|
||||
_JS_KEYS("mcast_rejoin", "count"),
|
||||
_VAL_INT32_RANGE(-1, 0, G_MAXINT32), ),
|
||||
_INIT(0,
|
||||
NM_TEAM_ATTRIBUTE_MASTER_MCAST_REJOIN_INTERVAL,
|
||||
master.mcast_rejoin_interval,
|
||||
NM_TEAM_ATTRIBUTE_CONTROLLER_MCAST_REJOIN_INTERVAL,
|
||||
controller.mcast_rejoin_interval,
|
||||
NM_VALUE_TYPE_INT32,
|
||||
NM_SETTING_TEAM_MCAST_REJOIN_INTERVAL,
|
||||
_JS_KEYS("mcast_rejoin", "interval"),
|
||||
_VAL_INT32_RANGE(-1, 0, G_MAXINT32), ),
|
||||
_INIT(0,
|
||||
NM_TEAM_ATTRIBUTE_MASTER_RUNNER,
|
||||
master.runner,
|
||||
NM_TEAM_ATTRIBUTE_CONTROLLER_RUNNER,
|
||||
controller.runner,
|
||||
NM_VALUE_TYPE_STRING,
|
||||
NM_SETTING_TEAM_RUNNER,
|
||||
_JS_KEYS("runner", "name"),
|
||||
_VAL_STRING_RANGE(_valid_names_runner), ),
|
||||
_INIT(0,
|
||||
NM_TEAM_ATTRIBUTE_MASTER_RUNNER_HWADDR_POLICY,
|
||||
master.runner_hwaddr_policy,
|
||||
NM_TEAM_ATTRIBUTE_CONTROLLER_RUNNER_HWADDR_POLICY,
|
||||
controller.runner_hwaddr_policy,
|
||||
NM_VALUE_TYPE_STRING,
|
||||
NM_SETTING_TEAM_RUNNER_HWADDR_POLICY,
|
||||
_JS_KEYS("runner", "hwaddr_policy"),
|
||||
_VAL_STRING_RANGE(_valid_names_runner_hwaddr_policy), ),
|
||||
_INIT(0,
|
||||
NM_TEAM_ATTRIBUTE_MASTER_RUNNER_TX_HASH,
|
||||
master.runner_tx_hash,
|
||||
NM_TEAM_ATTRIBUTE_CONTROLLER_RUNNER_TX_HASH,
|
||||
controller.runner_tx_hash,
|
||||
NM_VALUE_TYPE_UNSPEC,
|
||||
NM_SETTING_TEAM_RUNNER_TX_HASH,
|
||||
_JS_KEYS("runner", "tx_hash"),
|
||||
_VAL_UNSPEC(), ),
|
||||
_INIT(0,
|
||||
NM_TEAM_ATTRIBUTE_MASTER_RUNNER_TX_BALANCER,
|
||||
master.runner_tx_balancer,
|
||||
NM_TEAM_ATTRIBUTE_CONTROLLER_RUNNER_TX_BALANCER,
|
||||
controller.runner_tx_balancer,
|
||||
NM_VALUE_TYPE_STRING,
|
||||
NM_SETTING_TEAM_RUNNER_TX_BALANCER,
|
||||
_JS_KEYS("runner", "tx_balancer", "name"),
|
||||
_VAL_STRING_RANGE(_valid_names_runner_tx_balancer), ),
|
||||
_INIT(0,
|
||||
NM_TEAM_ATTRIBUTE_MASTER_RUNNER_TX_BALANCER_INTERVAL,
|
||||
master.runner_tx_balancer_interval,
|
||||
NM_TEAM_ATTRIBUTE_CONTROLLER_RUNNER_TX_BALANCER_INTERVAL,
|
||||
controller.runner_tx_balancer_interval,
|
||||
NM_VALUE_TYPE_INT32,
|
||||
NM_SETTING_TEAM_RUNNER_TX_BALANCER_INTERVAL,
|
||||
_JS_KEYS("runner", "tx_balancer", "balancing_interval"),
|
||||
_VAL_INT32_RANGE(-1, 0, G_MAXINT32), ),
|
||||
_INIT(0,
|
||||
NM_TEAM_ATTRIBUTE_MASTER_RUNNER_ACTIVE,
|
||||
master.runner_active,
|
||||
NM_TEAM_ATTRIBUTE_CONTROLLER_RUNNER_ACTIVE,
|
||||
controller.runner_active,
|
||||
NM_VALUE_TYPE_BOOL,
|
||||
NM_SETTING_TEAM_RUNNER_ACTIVE,
|
||||
_JS_KEYS("runner", "active"),
|
||||
_VAL_BOOL(TRUE), ),
|
||||
_INIT(0,
|
||||
NM_TEAM_ATTRIBUTE_MASTER_RUNNER_FAST_RATE,
|
||||
master.runner_fast_rate,
|
||||
NM_TEAM_ATTRIBUTE_CONTROLLER_RUNNER_FAST_RATE,
|
||||
controller.runner_fast_rate,
|
||||
NM_VALUE_TYPE_BOOL,
|
||||
NM_SETTING_TEAM_RUNNER_FAST_RATE,
|
||||
_JS_KEYS("runner", "fast_rate"),
|
||||
_VAL_BOOL(FALSE), ),
|
||||
_INIT(0,
|
||||
NM_TEAM_ATTRIBUTE_MASTER_RUNNER_SYS_PRIO,
|
||||
master.runner_sys_prio,
|
||||
NM_TEAM_ATTRIBUTE_CONTROLLER_RUNNER_SYS_PRIO,
|
||||
controller.runner_sys_prio,
|
||||
NM_VALUE_TYPE_INT32,
|
||||
NM_SETTING_TEAM_RUNNER_SYS_PRIO,
|
||||
_JS_KEYS("runner", "sys_prio"),
|
||||
_VAL_INT32_RANGE(-1, 0, USHRT_MAX + 1), ),
|
||||
_INIT(0,
|
||||
NM_TEAM_ATTRIBUTE_MASTER_RUNNER_MIN_PORTS,
|
||||
master.runner_min_ports,
|
||||
NM_TEAM_ATTRIBUTE_CONTROLLER_RUNNER_MIN_PORTS,
|
||||
controller.runner_min_ports,
|
||||
NM_VALUE_TYPE_INT32,
|
||||
NM_SETTING_TEAM_RUNNER_MIN_PORTS,
|
||||
_JS_KEYS("runner", "min_ports"),
|
||||
_VAL_INT32_RANGE(-1, 1, UCHAR_MAX + 1), ),
|
||||
_INIT(0,
|
||||
NM_TEAM_ATTRIBUTE_MASTER_RUNNER_AGG_SELECT_POLICY,
|
||||
master.runner_agg_select_policy,
|
||||
NM_TEAM_ATTRIBUTE_CONTROLLER_RUNNER_AGG_SELECT_POLICY,
|
||||
controller.runner_agg_select_policy,
|
||||
NM_VALUE_TYPE_STRING,
|
||||
NM_SETTING_TEAM_RUNNER_AGG_SELECT_POLICY,
|
||||
_JS_KEYS("runner", "agg_select_policy"),
|
||||
|
|
@ -437,7 +437,7 @@ _team_attr_data_ASSERT(const TeamAttrData *attr_data)
|
|||
nm_assert(attr_data);
|
||||
if (attr_data->for_port)
|
||||
nm_assert(attr_data == _team_attr_data_get(TRUE, attr_data->team_attr));
|
||||
if (attr_data->for_master)
|
||||
if (attr_data->for_controller)
|
||||
nm_assert(attr_data == _team_attr_data_get(FALSE, attr_data->team_attr));
|
||||
nm_assert((attr_data - team_attr_datas)
|
||||
== TEAM_ATTR_IDX(attr_data->for_port, attr_data->team_attr));
|
||||
|
|
@ -463,7 +463,7 @@ _team_attr_data_ASSERT(const TeamAttrData *attr_data)
|
|||
static gboolean
|
||||
_team_attr_data_is_relevant(const TeamAttrData *attr_data, gboolean is_port)
|
||||
{
|
||||
return is_port ? attr_data->for_port : attr_data->for_master;
|
||||
return is_port ? attr_data->for_port : attr_data->for_controller;
|
||||
}
|
||||
|
||||
static const TeamAttrData *
|
||||
|
|
@ -520,7 +520,7 @@ _team_attr_data_cmp(const TeamAttrData *attr_data,
|
|||
len,
|
||||
FALSE));
|
||||
}
|
||||
} else if (!is_port && attr_data->team_attr == NM_TEAM_ATTRIBUTE_MASTER_RUNNER_TX_HASH) {
|
||||
} else if (!is_port && attr_data->team_attr == NM_TEAM_ATTRIBUTE_CONTROLLER_RUNNER_TX_HASH) {
|
||||
v_ptrarray_a = *((const GPtrArray *const *) val_a);
|
||||
v_ptrarray_b = *((const GPtrArray *const *) val_b);
|
||||
NM_CMP_RETURN(nm_strv_cmp_n(v_ptrarray_a ? (const char *const *) v_ptrarray_a->pdata : NULL,
|
||||
|
|
@ -574,7 +574,7 @@ _team_attr_data_copy(const TeamAttrData *attr_data,
|
|||
g_ptr_array_unref(v_ptrarray_dst);
|
||||
*((GPtrArray **) dst) = dst_array;
|
||||
}
|
||||
} else if (!is_port && attr_data->team_attr == NM_TEAM_ATTRIBUTE_MASTER_RUNNER_TX_HASH) {
|
||||
} else if (!is_port && attr_data->team_attr == NM_TEAM_ATTRIBUTE_CONTROLLER_RUNNER_TX_HASH) {
|
||||
v_ptrarray_src = *((const GPtrArray *const *) src);
|
||||
v_ptrarray_dst = *((GPtrArray **) dst);
|
||||
len = (v_ptrarray_src ? v_ptrarray_src->len : 0u);
|
||||
|
|
@ -631,7 +631,7 @@ _team_attr_data_to_json(const TeamAttrData *attr_data,
|
|||
return;
|
||||
}
|
||||
|
||||
if (!is_port && attr_data->team_attr == NM_TEAM_ATTRIBUTE_MASTER_RUNNER_TX_HASH) {
|
||||
if (!is_port && attr_data->team_attr == NM_TEAM_ATTRIBUTE_CONTROLLER_RUNNER_TX_HASH) {
|
||||
const GPtrArray *v_ptrarray = *((const GPtrArray *const *) p_field);
|
||||
|
||||
if (!v_ptrarray)
|
||||
|
|
@ -664,8 +664,8 @@ _team_setting_ASSERT(const NMTeamSetting *self)
|
|||
nm_assert(self->d._js_str);
|
||||
}
|
||||
nm_assert(self->d.link_watchers);
|
||||
nm_assert(self->d.is_port || !self->d.master.runner_tx_hash
|
||||
|| self->d.master.runner_tx_hash->len > 0);
|
||||
nm_assert(self->d.is_port || !self->d.controller.runner_tx_hash
|
||||
|| self->d.controller.runner_tx_hash->len > 0);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
@ -736,9 +736,10 @@ _team_setting_get_field(const NMTeamSetting *self, const TeamAttrData *attr_data
|
|||
nm_assert(_team_attr_data_is_relevant(attr_data, self->d.is_port));
|
||||
|
||||
#if NM_MORE_ASSERTS > 5
|
||||
if (attr_data->for_master && attr_data->team_attr == NM_TEAM_ATTRIBUTE_MASTER_RUNNER_SYS_PRIO)
|
||||
if (attr_data->for_controller
|
||||
&& attr_data->team_attr == NM_TEAM_ATTRIBUTE_CONTROLLER_RUNNER_SYS_PRIO)
|
||||
nm_assert((gpointer) (((char *) self) + attr_data->field_offset)
|
||||
== &self->d.master.runner_sys_prio);
|
||||
== &self->d.controller.runner_sys_prio);
|
||||
#endif
|
||||
|
||||
return (((char *) self) + attr_data->field_offset);
|
||||
|
|
@ -1088,57 +1089,58 @@ nm_team_setting_value_link_watchers_set_list(NMTeamSetting *sel
|
|||
/*****************************************************************************/
|
||||
|
||||
guint32
|
||||
nm_team_setting_value_master_runner_tx_hash_add(NMTeamSetting *self, const char *txhash)
|
||||
nm_team_setting_value_controller_runner_tx_hash_add(NMTeamSetting *self, const char *txhash)
|
||||
{
|
||||
gboolean changed;
|
||||
guint i;
|
||||
|
||||
if (!self->d.master.runner_tx_hash)
|
||||
self->_data_priv.master.runner_tx_hash = g_ptr_array_new_with_free_func(g_free);
|
||||
if (!self->d.controller.runner_tx_hash)
|
||||
self->_data_priv.controller.runner_tx_hash = g_ptr_array_new_with_free_func(g_free);
|
||||
else {
|
||||
for (i = 0; i < self->d.master.runner_tx_hash->len; i++) {
|
||||
if (nm_streq(txhash, self->d.master.runner_tx_hash->pdata[i])) {
|
||||
for (i = 0; i < self->d.controller.runner_tx_hash->len; i++) {
|
||||
if (nm_streq(txhash, self->d.controller.runner_tx_hash->pdata[i])) {
|
||||
changed = FALSE;
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
}
|
||||
changed = TRUE;
|
||||
g_ptr_array_add((GPtrArray *) self->d.master.runner_tx_hash, g_strdup(txhash));
|
||||
g_ptr_array_add((GPtrArray *) self->d.controller.runner_tx_hash, g_strdup(txhash));
|
||||
out:
|
||||
return _team_setting_attribute_changed_attr(self,
|
||||
NM_TEAM_ATTRIBUTE_MASTER_RUNNER_TX_HASH,
|
||||
NM_TEAM_ATTRIBUTE_CONTROLLER_RUNNER_TX_HASH,
|
||||
changed,
|
||||
SET_FIELD_MODE_SET_UNLESS_DEFAULT,
|
||||
RESET_JSON_YES);
|
||||
}
|
||||
|
||||
guint32
|
||||
nm_team_setting_value_master_runner_tx_hash_remove(NMTeamSetting *self, guint idx)
|
||||
nm_team_setting_value_controller_runner_tx_hash_remove(NMTeamSetting *self, guint idx)
|
||||
{
|
||||
g_ptr_array_remove_index((GPtrArray *) self->d.master.runner_tx_hash, idx);
|
||||
g_ptr_array_remove_index((GPtrArray *) self->d.controller.runner_tx_hash, idx);
|
||||
return _team_setting_attribute_changed_attr(self,
|
||||
NM_TEAM_ATTRIBUTE_MASTER_RUNNER_TX_HASH,
|
||||
NM_TEAM_ATTRIBUTE_CONTROLLER_RUNNER_TX_HASH,
|
||||
TRUE,
|
||||
SET_FIELD_MODE_SET_UNLESS_DEFAULT,
|
||||
RESET_JSON_YES);
|
||||
}
|
||||
|
||||
static guint32
|
||||
_team_setting_value_master_runner_tx_hash_set_list(NMTeamSetting *self,
|
||||
const char *const *arr,
|
||||
guint len,
|
||||
SetFieldModeEnum set_field_mode,
|
||||
ResetJsonEnum reset_json)
|
||||
_team_setting_value_controller_runner_tx_hash_set_list(NMTeamSetting *self,
|
||||
const char *const *arr,
|
||||
guint len,
|
||||
SetFieldModeEnum set_field_mode,
|
||||
ResetJsonEnum reset_json)
|
||||
{
|
||||
_nm_unused gs_unref_ptrarray GPtrArray *old_val_destroy = NULL;
|
||||
gboolean changed;
|
||||
guint i;
|
||||
|
||||
if (nm_strv_cmp_n(self->d.master.runner_tx_hash
|
||||
? (const char *const *) self->d.master.runner_tx_hash->pdata
|
||||
if (nm_strv_cmp_n(self->d.controller.runner_tx_hash
|
||||
? (const char *const *) self->d.controller.runner_tx_hash->pdata
|
||||
: NULL,
|
||||
self->d.master.runner_tx_hash ? self->d.master.runner_tx_hash->len : 0u,
|
||||
self->d.controller.runner_tx_hash ? self->d.controller.runner_tx_hash->len
|
||||
: 0u,
|
||||
arr,
|
||||
len)
|
||||
== 0) {
|
||||
|
|
@ -1148,34 +1150,34 @@ _team_setting_value_master_runner_tx_hash_set_list(NMTeamSetting *self,
|
|||
|
||||
changed = TRUE;
|
||||
|
||||
old_val_destroy = (GPtrArray *) g_steal_pointer(&self->_data_priv.master.runner_tx_hash);
|
||||
old_val_destroy = (GPtrArray *) g_steal_pointer(&self->_data_priv.controller.runner_tx_hash);
|
||||
|
||||
for (i = 0; i < len; i++) {
|
||||
if (!arr[i])
|
||||
continue;
|
||||
if (!self->d.master.runner_tx_hash)
|
||||
self->_data_priv.master.runner_tx_hash = g_ptr_array_new_with_free_func(g_free);
|
||||
g_ptr_array_add((GPtrArray *) self->d.master.runner_tx_hash, g_strdup(arr[i]));
|
||||
if (!self->d.controller.runner_tx_hash)
|
||||
self->_data_priv.controller.runner_tx_hash = g_ptr_array_new_with_free_func(g_free);
|
||||
g_ptr_array_add((GPtrArray *) self->d.controller.runner_tx_hash, g_strdup(arr[i]));
|
||||
}
|
||||
|
||||
out:
|
||||
return _team_setting_attribute_changed_attr(self,
|
||||
NM_TEAM_ATTRIBUTE_MASTER_RUNNER_TX_HASH,
|
||||
NM_TEAM_ATTRIBUTE_CONTROLLER_RUNNER_TX_HASH,
|
||||
changed,
|
||||
set_field_mode,
|
||||
reset_json);
|
||||
}
|
||||
|
||||
guint32
|
||||
nm_team_setting_value_master_runner_tx_hash_set_list(NMTeamSetting *self,
|
||||
const char *const *arr,
|
||||
guint len)
|
||||
nm_team_setting_value_controller_runner_tx_hash_set_list(NMTeamSetting *self,
|
||||
const char *const *arr,
|
||||
guint len)
|
||||
{
|
||||
return _team_setting_value_master_runner_tx_hash_set_list(self,
|
||||
arr,
|
||||
len,
|
||||
SET_FIELD_MODE_SET_UNLESS_DEFAULT,
|
||||
RESET_JSON_YES);
|
||||
return _team_setting_value_controller_runner_tx_hash_set_list(self,
|
||||
arr,
|
||||
len,
|
||||
SET_FIELD_MODE_SET_UNLESS_DEFAULT,
|
||||
RESET_JSON_YES);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
|
@ -1769,28 +1771,28 @@ nm_team_setting_config_get(const NMTeamSetting *self)
|
|||
list_is_empty = FALSE;
|
||||
} else {
|
||||
static const NMTeamAttribute attr_lst_runner_pt1[] = {
|
||||
NM_TEAM_ATTRIBUTE_MASTER_RUNNER,
|
||||
NM_TEAM_ATTRIBUTE_MASTER_RUNNER_HWADDR_POLICY,
|
||||
NM_TEAM_ATTRIBUTE_MASTER_RUNNER_TX_HASH,
|
||||
NM_TEAM_ATTRIBUTE_CONTROLLER_RUNNER,
|
||||
NM_TEAM_ATTRIBUTE_CONTROLLER_RUNNER_HWADDR_POLICY,
|
||||
NM_TEAM_ATTRIBUTE_CONTROLLER_RUNNER_TX_HASH,
|
||||
};
|
||||
static const NMTeamAttribute attr_lst_runner_pt2[] = {
|
||||
NM_TEAM_ATTRIBUTE_MASTER_RUNNER_TX_BALANCER,
|
||||
NM_TEAM_ATTRIBUTE_MASTER_RUNNER_TX_BALANCER_INTERVAL,
|
||||
NM_TEAM_ATTRIBUTE_CONTROLLER_RUNNER_TX_BALANCER,
|
||||
NM_TEAM_ATTRIBUTE_CONTROLLER_RUNNER_TX_BALANCER_INTERVAL,
|
||||
};
|
||||
static const NMTeamAttribute attr_lst_runner_pt3[] = {
|
||||
NM_TEAM_ATTRIBUTE_MASTER_RUNNER_ACTIVE,
|
||||
NM_TEAM_ATTRIBUTE_MASTER_RUNNER_FAST_RATE,
|
||||
NM_TEAM_ATTRIBUTE_MASTER_RUNNER_SYS_PRIO,
|
||||
NM_TEAM_ATTRIBUTE_MASTER_RUNNER_MIN_PORTS,
|
||||
NM_TEAM_ATTRIBUTE_MASTER_RUNNER_AGG_SELECT_POLICY,
|
||||
NM_TEAM_ATTRIBUTE_CONTROLLER_RUNNER_ACTIVE,
|
||||
NM_TEAM_ATTRIBUTE_CONTROLLER_RUNNER_FAST_RATE,
|
||||
NM_TEAM_ATTRIBUTE_CONTROLLER_RUNNER_SYS_PRIO,
|
||||
NM_TEAM_ATTRIBUTE_CONTROLLER_RUNNER_MIN_PORTS,
|
||||
NM_TEAM_ATTRIBUTE_CONTROLLER_RUNNER_AGG_SELECT_POLICY,
|
||||
};
|
||||
static const NMTeamAttribute attr_lst_notify_peers[] = {
|
||||
NM_TEAM_ATTRIBUTE_MASTER_NOTIFY_PEERS_COUNT,
|
||||
NM_TEAM_ATTRIBUTE_MASTER_NOTIFY_PEERS_INTERVAL,
|
||||
NM_TEAM_ATTRIBUTE_CONTROLLER_NOTIFY_PEERS_COUNT,
|
||||
NM_TEAM_ATTRIBUTE_CONTROLLER_NOTIFY_PEERS_INTERVAL,
|
||||
};
|
||||
static const NMTeamAttribute attr_lst_mcast_rejoin[] = {
|
||||
NM_TEAM_ATTRIBUTE_MASTER_MCAST_REJOIN_COUNT,
|
||||
NM_TEAM_ATTRIBUTE_MASTER_MCAST_REJOIN_INTERVAL,
|
||||
NM_TEAM_ATTRIBUTE_CONTROLLER_MCAST_REJOIN_COUNT,
|
||||
NM_TEAM_ATTRIBUTE_CONTROLLER_MCAST_REJOIN_INTERVAL,
|
||||
};
|
||||
|
||||
if (_team_setting_has_fields_any_v(self,
|
||||
|
|
@ -2012,7 +2014,7 @@ _js_parse_unpack(const NMJsonVt *vt,
|
|||
NMValueTypUnion out_val_lst[static _NM_TEAM_ATTRIBUTE_NUM],
|
||||
gboolean *out_unrecognized_content,
|
||||
GPtrArray **out_ptr_array_link_watchers_free,
|
||||
GPtrArray **out_ptr_array_master_runner_tx_hash_free)
|
||||
GPtrArray **out_ptr_array_controller_runner_tx_hash_free)
|
||||
{
|
||||
const TeamAttrData *attr_data;
|
||||
|
||||
|
|
@ -2069,11 +2071,11 @@ _js_parse_unpack(const NMJsonVt *vt,
|
|||
p_out_val->v_ptrarray = link_watchers;
|
||||
*out_ptr_array_link_watchers_free = link_watchers;
|
||||
}
|
||||
} else if (!is_port && attr_data->team_attr == NM_TEAM_ATTRIBUTE_MASTER_RUNNER_TX_HASH) {
|
||||
} else if (!is_port && attr_data->team_attr == NM_TEAM_ATTRIBUTE_CONTROLLER_RUNNER_TX_HASH) {
|
||||
GPtrArray *strv = NULL;
|
||||
|
||||
nm_assert(out_ptr_array_master_runner_tx_hash_free
|
||||
&& !*out_ptr_array_master_runner_tx_hash_free);
|
||||
nm_assert(out_ptr_array_controller_runner_tx_hash_free
|
||||
&& !*out_ptr_array_controller_runner_tx_hash_free);
|
||||
if (nm_json_is_array(arg_js_obj)) {
|
||||
gsize i, len;
|
||||
|
||||
|
|
@ -2096,8 +2098,8 @@ _js_parse_unpack(const NMJsonVt *vt,
|
|||
g_ptr_array_add(strv, (char *) v_string);
|
||||
}
|
||||
}
|
||||
valid = TRUE;
|
||||
*out_ptr_array_master_runner_tx_hash_free = strv;
|
||||
valid = TRUE;
|
||||
*out_ptr_array_controller_runner_tx_hash_free = strv;
|
||||
}
|
||||
p_out_val->v_ptrarray = strv;
|
||||
} else
|
||||
|
|
@ -2154,8 +2156,8 @@ nm_team_setting_config_set(NMTeamSetting *self, const char *js_str)
|
|||
nm_json_t *found_keys[_NM_TEAM_ATTRIBUTE_NUM] = {
|
||||
NULL,
|
||||
};
|
||||
gs_unref_ptrarray GPtrArray *ptr_array_master_runner_tx_hash_free = NULL;
|
||||
gs_unref_ptrarray GPtrArray *ptr_array_link_watchers_free = NULL;
|
||||
gs_unref_ptrarray GPtrArray *ptr_array_controller_runner_tx_hash_free = NULL;
|
||||
gs_unref_ptrarray GPtrArray *ptr_array_link_watchers_free = NULL;
|
||||
|
||||
_js_parse_locate_keys(vt, self, root_js_obj, found_keys, &unrecognized_content);
|
||||
|
||||
|
|
@ -2166,7 +2168,7 @@ nm_team_setting_config_set(NMTeamSetting *self, const char *js_str)
|
|||
val_lst,
|
||||
&unrecognized_content,
|
||||
&ptr_array_link_watchers_free,
|
||||
&ptr_array_master_runner_tx_hash_free);
|
||||
&ptr_array_controller_runner_tx_hash_free);
|
||||
|
||||
do_set_default = FALSE;
|
||||
|
||||
|
|
@ -2199,14 +2201,14 @@ _team_setting_prefix_error_plain(gboolean is_port, const char *property_name, GE
|
|||
|
||||
static void
|
||||
_team_setting_prefix_error(const NMTeamSetting *self,
|
||||
const char *prop_name_master,
|
||||
const char *prop_name_controller,
|
||||
const char *prop_name_port,
|
||||
GError **error)
|
||||
{
|
||||
_team_setting_ASSERT(self);
|
||||
nm_assert(self->d.is_port ? (!!prop_name_port) : (!!prop_name_master));
|
||||
nm_assert(self->d.is_port ? (!!prop_name_port) : (!!prop_name_controller));
|
||||
_team_setting_prefix_error_plain(self->d.is_port,
|
||||
self->d.is_port ? prop_name_port : prop_name_master,
|
||||
self->d.is_port ? prop_name_port : prop_name_controller,
|
||||
error);
|
||||
}
|
||||
|
||||
|
|
@ -2258,10 +2260,10 @@ _team_setting_verify_properties(const NMTeamSetting *self, GError **error)
|
|||
nm_assert_not_reached();
|
||||
}
|
||||
|
||||
if (!self->d.is_port && attr_data->team_attr == NM_TEAM_ATTRIBUTE_MASTER_RUNNER_TX_HASH) {
|
||||
if (self->d.master.runner_tx_hash) {
|
||||
for (i = 0; i < self->d.master.runner_tx_hash->len; i++) {
|
||||
const char *val = self->d.master.runner_tx_hash->pdata[i];
|
||||
if (!self->d.is_port && attr_data->team_attr == NM_TEAM_ATTRIBUTE_CONTROLLER_RUNNER_TX_HASH) {
|
||||
if (self->d.controller.runner_tx_hash) {
|
||||
for (i = 0; i < self->d.controller.runner_tx_hash->len; i++) {
|
||||
const char *val = self->d.controller.runner_tx_hash->pdata[i];
|
||||
|
||||
if (!val || !nm_strv_contains(_valid_names_runner_tx_hash, -1, val)) {
|
||||
g_set_error(error,
|
||||
|
|
@ -2288,8 +2290,8 @@ _team_setting_verify_properties(const NMTeamSetting *self, GError **error)
|
|||
|
||||
if (!_team_setting_has_field(self, attr_data))
|
||||
continue;
|
||||
if (self->d.master.runner
|
||||
&& nm_strv_contains(e->valid_runners, -1, self->d.master.runner))
|
||||
if (self->d.controller.runner
|
||||
&& nm_strv_contains(e->valid_runners, -1, self->d.controller.runner))
|
||||
continue;
|
||||
if (e->valid_runners[1] == NULL) {
|
||||
g_set_error(error,
|
||||
|
|
@ -2542,7 +2544,7 @@ nm_team_setting_reset_from_dbus(NMTeamSetting *self,
|
|||
else if (attr_data->team_attr == NM_TEAM_ATTRIBUTE_LINK_WATCHERS)
|
||||
variant_type = G_VARIANT_TYPE("aa{sv}");
|
||||
else if (!self->d.is_port
|
||||
&& attr_data->team_attr == NM_TEAM_ATTRIBUTE_MASTER_RUNNER_TX_HASH)
|
||||
&& attr_data->team_attr == NM_TEAM_ATTRIBUTE_CONTROLLER_RUNNER_TX_HASH)
|
||||
variant_type = G_VARIANT_TYPE_STRING_ARRAY;
|
||||
else
|
||||
nm_assert_not_reached();
|
||||
|
|
@ -2645,12 +2647,12 @@ nm_team_setting_reset_from_dbus(NMTeamSetting *self,
|
|||
SET_FIELD_MODE_SET,
|
||||
RESET_JSON_NO);
|
||||
} else if (!self->d.is_port
|
||||
&& attr_data->team_attr == NM_TEAM_ATTRIBUTE_MASTER_RUNNER_TX_HASH) {
|
||||
&& attr_data->team_attr == NM_TEAM_ATTRIBUTE_CONTROLLER_RUNNER_TX_HASH) {
|
||||
gs_free const char **strv = NULL;
|
||||
gsize len;
|
||||
|
||||
strv = g_variant_get_strv(variants[attr_data->team_attr], &len);
|
||||
changed_flags = _team_setting_value_master_runner_tx_hash_set_list(
|
||||
changed_flags = _team_setting_value_controller_runner_tx_hash_set_list(
|
||||
self,
|
||||
strv,
|
||||
NM_MIN(len, (gsize) G_MAXUINT),
|
||||
|
|
@ -2756,12 +2758,12 @@ _nm_team_settings_property_to_dbus(_NM_SETT_INFO_PROP_TO_DBUS_FCN_ARGS _nm_nil)
|
|||
}
|
||||
if (attr_data->team_attr == NM_TEAM_ATTRIBUTE_LINK_WATCHERS)
|
||||
return _nm_utils_team_link_watchers_to_variant(self->d.link_watchers);
|
||||
if (!self->d.is_port && attr_data->team_attr == NM_TEAM_ATTRIBUTE_MASTER_RUNNER_TX_HASH) {
|
||||
return g_variant_new_strv(self->d.master.runner_tx_hash
|
||||
? (const char *const *) self->d.master.runner_tx_hash->pdata
|
||||
: NULL,
|
||||
self->d.master.runner_tx_hash ? self->d.master.runner_tx_hash->len
|
||||
: 0u);
|
||||
if (!self->d.is_port && attr_data->team_attr == NM_TEAM_ATTRIBUTE_CONTROLLER_RUNNER_TX_HASH) {
|
||||
return g_variant_new_strv(
|
||||
self->d.controller.runner_tx_hash
|
||||
? (const char *const *) self->d.controller.runner_tx_hash->pdata
|
||||
: NULL,
|
||||
self->d.controller.runner_tx_hash ? self->d.controller.runner_tx_hash->len : 0u);
|
||||
}
|
||||
|
||||
nm_assert_not_reached();
|
||||
|
|
@ -2836,12 +2838,12 @@ nm_team_setting_free(NMTeamSetting *self)
|
|||
_team_setting_ASSERT(self);
|
||||
|
||||
if (!self->d.is_port) {
|
||||
nm_clear_pointer(((GPtrArray **) &self->_data_priv.master.runner_tx_hash),
|
||||
nm_clear_pointer(((GPtrArray **) &self->_data_priv.controller.runner_tx_hash),
|
||||
g_ptr_array_unref);
|
||||
g_free((char *) self->_data_priv.master.runner);
|
||||
g_free((char *) self->_data_priv.master.runner_hwaddr_policy);
|
||||
g_free((char *) self->_data_priv.master.runner_tx_balancer);
|
||||
g_free((char *) self->_data_priv.master.runner_agg_select_policy);
|
||||
g_free((char *) self->_data_priv.controller.runner);
|
||||
g_free((char *) self->_data_priv.controller.runner_hwaddr_policy);
|
||||
g_free((char *) self->_data_priv.controller.runner_tx_balancer);
|
||||
g_free((char *) self->_data_priv.controller.runner_agg_select_policy);
|
||||
}
|
||||
g_ptr_array_unref((GPtrArray *) self->_data_priv.link_watchers);
|
||||
g_free((char *) self->_data_priv._js_str);
|
||||
|
|
|
|||
|
|
@ -25,21 +25,21 @@ typedef enum {
|
|||
|
||||
_NM_TEAM_ATTRIBUTE_START = 3,
|
||||
|
||||
NM_TEAM_ATTRIBUTE_MASTER_NOTIFY_PEERS_COUNT = _NM_TEAM_ATTRIBUTE_START,
|
||||
NM_TEAM_ATTRIBUTE_MASTER_NOTIFY_PEERS_INTERVAL,
|
||||
NM_TEAM_ATTRIBUTE_MASTER_MCAST_REJOIN_COUNT,
|
||||
NM_TEAM_ATTRIBUTE_MASTER_MCAST_REJOIN_INTERVAL,
|
||||
NM_TEAM_ATTRIBUTE_MASTER_RUNNER,
|
||||
NM_TEAM_ATTRIBUTE_MASTER_RUNNER_HWADDR_POLICY,
|
||||
NM_TEAM_ATTRIBUTE_MASTER_RUNNER_TX_HASH,
|
||||
NM_TEAM_ATTRIBUTE_MASTER_RUNNER_TX_BALANCER,
|
||||
NM_TEAM_ATTRIBUTE_MASTER_RUNNER_TX_BALANCER_INTERVAL,
|
||||
NM_TEAM_ATTRIBUTE_MASTER_RUNNER_ACTIVE,
|
||||
NM_TEAM_ATTRIBUTE_MASTER_RUNNER_FAST_RATE,
|
||||
NM_TEAM_ATTRIBUTE_MASTER_RUNNER_SYS_PRIO,
|
||||
NM_TEAM_ATTRIBUTE_MASTER_RUNNER_MIN_PORTS,
|
||||
NM_TEAM_ATTRIBUTE_MASTER_RUNNER_AGG_SELECT_POLICY,
|
||||
_NM_TEAM_ATTRIBUTE_MASTER_NUM,
|
||||
NM_TEAM_ATTRIBUTE_CONTROLLER_NOTIFY_PEERS_COUNT = _NM_TEAM_ATTRIBUTE_START,
|
||||
NM_TEAM_ATTRIBUTE_CONTROLLER_NOTIFY_PEERS_INTERVAL,
|
||||
NM_TEAM_ATTRIBUTE_CONTROLLER_MCAST_REJOIN_COUNT,
|
||||
NM_TEAM_ATTRIBUTE_CONTROLLER_MCAST_REJOIN_INTERVAL,
|
||||
NM_TEAM_ATTRIBUTE_CONTROLLER_RUNNER,
|
||||
NM_TEAM_ATTRIBUTE_CONTROLLER_RUNNER_HWADDR_POLICY,
|
||||
NM_TEAM_ATTRIBUTE_CONTROLLER_RUNNER_TX_HASH,
|
||||
NM_TEAM_ATTRIBUTE_CONTROLLER_RUNNER_TX_BALANCER,
|
||||
NM_TEAM_ATTRIBUTE_CONTROLLER_RUNNER_TX_BALANCER_INTERVAL,
|
||||
NM_TEAM_ATTRIBUTE_CONTROLLER_RUNNER_ACTIVE,
|
||||
NM_TEAM_ATTRIBUTE_CONTROLLER_RUNNER_FAST_RATE,
|
||||
NM_TEAM_ATTRIBUTE_CONTROLLER_RUNNER_SYS_PRIO,
|
||||
NM_TEAM_ATTRIBUTE_CONTROLLER_RUNNER_MIN_PORTS,
|
||||
NM_TEAM_ATTRIBUTE_CONTROLLER_RUNNER_AGG_SELECT_POLICY,
|
||||
_NM_TEAM_ATTRIBUTE_CONTROLLER_NUM,
|
||||
|
||||
NM_TEAM_ATTRIBUTE_PORT_QUEUE_ID = _NM_TEAM_ATTRIBUTE_START,
|
||||
NM_TEAM_ATTRIBUTE_PORT_PRIO,
|
||||
|
|
@ -49,7 +49,7 @@ typedef enum {
|
|||
_NM_TEAM_ATTRIBUTE_PORT_NUM,
|
||||
|
||||
_NM_TEAM_ATTRIBUTE_NUM =
|
||||
NM_MAX_CONST(_NM_TEAM_ATTRIBUTE_MASTER_NUM, _NM_TEAM_ATTRIBUTE_PORT_NUM),
|
||||
NM_MAX_CONST(_NM_TEAM_ATTRIBUTE_CONTROLLER_NUM, _NM_TEAM_ATTRIBUTE_PORT_NUM),
|
||||
|
||||
} NMTeamAttribute;
|
||||
|
||||
|
|
@ -101,7 +101,7 @@ struct _NMTeamSettingData {
|
|||
gint32 runner_tx_balancer_interval;
|
||||
bool runner_active;
|
||||
bool runner_fast_rate;
|
||||
} master;
|
||||
} controller;
|
||||
struct {
|
||||
gint32 queue_id;
|
||||
gint32 prio;
|
||||
|
|
@ -216,13 +216,14 @@ guint32 nm_team_setting_value_link_watchers_set_list(NMTeamSetting
|
|||
|
||||
/*****************************************************************************/
|
||||
|
||||
guint32 nm_team_setting_value_master_runner_tx_hash_add(NMTeamSetting *self, const char *txhash);
|
||||
guint32 nm_team_setting_value_controller_runner_tx_hash_add(NMTeamSetting *self,
|
||||
const char *txhash);
|
||||
|
||||
guint32 nm_team_setting_value_master_runner_tx_hash_remove(NMTeamSetting *self, guint idx);
|
||||
guint32 nm_team_setting_value_controller_runner_tx_hash_remove(NMTeamSetting *self, guint idx);
|
||||
|
||||
guint32 nm_team_setting_value_master_runner_tx_hash_set_list(NMTeamSetting *self,
|
||||
const char *const *arr,
|
||||
guint len);
|
||||
guint32 nm_team_setting_value_controller_runner_tx_hash_set_list(NMTeamSetting *self,
|
||||
const char *const *arr,
|
||||
guint len);
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
|
|
|
|||
|
|
@ -4903,9 +4903,9 @@ _nm_utils_dhcp_duid_valid(const char *duid, GBytes **out_duid_bin)
|
|||
* If @virtual_type is %NM_TYPE_SETTING_VLAN, then this checks if
|
||||
* @other_type is a valid type for the parent of a VLAN.
|
||||
*
|
||||
* If @virtual_type is a "master" type (eg, %NM_TYPE_SETTING_BRIDGE),
|
||||
* 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
|
||||
* master.
|
||||
* controller.
|
||||
*
|
||||
* Note that even if this returns %TRUE it is not guaranteed that
|
||||
* <emphasis>every</emphasis> connection of type @other_type is
|
||||
|
|
|
|||
|
|
@ -6243,7 +6243,7 @@ test_connection_normalize_slave_type_1(void)
|
|||
|
||||
g_object_set(s_con,
|
||||
NM_SETTING_CONNECTION_CONTROLLER,
|
||||
"master0",
|
||||
"controller0",
|
||||
NM_SETTING_CONNECTION_PORT_TYPE,
|
||||
"invalid-type",
|
||||
NULL);
|
||||
|
|
@ -6277,7 +6277,7 @@ test_connection_normalize_slave_type_2(void)
|
|||
|
||||
g_object_set(s_con,
|
||||
NM_SETTING_CONNECTION_CONTROLLER,
|
||||
"master0",
|
||||
"controller0",
|
||||
NM_SETTING_CONNECTION_PORT_TYPE,
|
||||
"invalid-type",
|
||||
NULL);
|
||||
|
|
@ -6576,7 +6576,7 @@ test_connection_normalize_ovs_interface_type_system(gconstpointer test_data)
|
|||
case 1:
|
||||
g_object_set(s_con,
|
||||
NM_SETTING_CONNECTION_CONTROLLER,
|
||||
"master0",
|
||||
"controller0",
|
||||
NM_SETTING_CONNECTION_PORT_TYPE,
|
||||
NM_SETTING_OVS_PORT_SETTING_NAME,
|
||||
NULL);
|
||||
|
|
@ -6597,7 +6597,7 @@ test_connection_normalize_ovs_interface_type_system(gconstpointer test_data)
|
|||
case 2:
|
||||
g_object_set(s_con,
|
||||
NM_SETTING_CONNECTION_CONTROLLER,
|
||||
"master0",
|
||||
"controller0",
|
||||
NM_SETTING_CONNECTION_PORT_TYPE,
|
||||
NM_SETTING_OVS_PORT_SETTING_NAME,
|
||||
NULL);
|
||||
|
|
@ -6620,7 +6620,7 @@ test_connection_normalize_ovs_interface_type_system(gconstpointer test_data)
|
|||
case 3:
|
||||
g_object_set(s_con,
|
||||
NM_SETTING_CONNECTION_CONTROLLER,
|
||||
"master0",
|
||||
"controller0",
|
||||
NM_SETTING_CONNECTION_PORT_TYPE,
|
||||
NM_SETTING_OVS_PORT_SETTING_NAME,
|
||||
NULL);
|
||||
|
|
@ -6638,7 +6638,7 @@ test_connection_normalize_ovs_interface_type_system(gconstpointer test_data)
|
|||
case 4:
|
||||
g_object_set(s_con,
|
||||
NM_SETTING_CONNECTION_CONTROLLER,
|
||||
"master0",
|
||||
"controller0",
|
||||
NM_SETTING_CONNECTION_PORT_TYPE,
|
||||
NM_SETTING_OVS_PORT_SETTING_NAME,
|
||||
NULL);
|
||||
|
|
@ -6653,7 +6653,7 @@ test_connection_normalize_ovs_interface_type_system(gconstpointer test_data)
|
|||
NM_CONNECTION_ERROR_INVALID_PROPERTY);
|
||||
break;
|
||||
case 5:
|
||||
g_object_set(s_con, NM_SETTING_CONNECTION_CONTROLLER, "master0", NULL);
|
||||
g_object_set(s_con, NM_SETTING_CONNECTION_CONTROLLER, "controller0", NULL);
|
||||
|
||||
s_ovs_if = NM_SETTING_OVS_INTERFACE(nm_setting_ovs_interface_new());
|
||||
nm_connection_add_setting(con, NM_SETTING(s_ovs_if));
|
||||
|
|
@ -6675,7 +6675,7 @@ test_connection_normalize_ovs_interface_type_system(gconstpointer test_data)
|
|||
case 6:
|
||||
g_object_set(s_con,
|
||||
NM_SETTING_CONNECTION_CONTROLLER,
|
||||
"master0",
|
||||
"controller0",
|
||||
NM_SETTING_CONNECTION_PORT_TYPE,
|
||||
NM_SETTING_BRIDGE_SETTING_NAME,
|
||||
NULL);
|
||||
|
|
@ -6691,7 +6691,7 @@ test_connection_normalize_ovs_interface_type_system(gconstpointer test_data)
|
|||
case 7:
|
||||
g_object_set(s_con,
|
||||
NM_SETTING_CONNECTION_CONTROLLER,
|
||||
"master0",
|
||||
"controller0",
|
||||
NM_SETTING_CONNECTION_PORT_TYPE,
|
||||
NM_SETTING_BRIDGE_SETTING_NAME,
|
||||
NULL);
|
||||
|
|
@ -6738,7 +6738,7 @@ test_connection_normalize_ovs_interface_type_ovs_interface(gconstpointer test_da
|
|||
NM_CONNECTION_ERROR_INVALID_PROPERTY);
|
||||
break;
|
||||
case 2:
|
||||
g_object_set(s_con, NM_SETTING_CONNECTION_CONTROLLER, "master0", NULL);
|
||||
g_object_set(s_con, NM_SETTING_CONNECTION_CONTROLLER, "controller0", NULL);
|
||||
nmtst_assert_connection_verifies_after_normalization(con,
|
||||
NM_CONNECTION_ERROR,
|
||||
NM_CONNECTION_ERROR_MISSING_PROPERTY);
|
||||
|
|
@ -6759,7 +6759,7 @@ test_connection_normalize_ovs_interface_type_ovs_interface(gconstpointer test_da
|
|||
case 3:
|
||||
g_object_set(s_con,
|
||||
NM_SETTING_CONNECTION_CONTROLLER,
|
||||
"master0",
|
||||
"controller0",
|
||||
NM_SETTING_CONNECTION_PORT_TYPE,
|
||||
NM_SETTING_OVS_PORT_SETTING_NAME,
|
||||
NULL);
|
||||
|
|
@ -6781,7 +6781,7 @@ test_connection_normalize_ovs_interface_type_ovs_interface(gconstpointer test_da
|
|||
g_assert_cmpstr(nm_setting_ovs_interface_get_interface_type(s_ovs_if), ==, "internal");
|
||||
break;
|
||||
case 4:
|
||||
g_object_set(s_con, NM_SETTING_CONNECTION_CONTROLLER, "master0", NULL);
|
||||
g_object_set(s_con, NM_SETTING_CONNECTION_CONTROLLER, "controller0", NULL);
|
||||
g_object_set(s_ovs_if, NM_SETTING_OVS_INTERFACE_TYPE, "internal", NULL);
|
||||
nmtst_assert_connection_verifies_after_normalization(con,
|
||||
NM_CONNECTION_ERROR,
|
||||
|
|
@ -6803,7 +6803,7 @@ test_connection_normalize_ovs_interface_type_ovs_interface(gconstpointer test_da
|
|||
case 5:
|
||||
g_object_set(s_con,
|
||||
NM_SETTING_CONNECTION_CONTROLLER,
|
||||
"master0",
|
||||
"controller0",
|
||||
NM_SETTING_CONNECTION_PORT_TYPE,
|
||||
NM_SETTING_OVS_PORT_SETTING_NAME,
|
||||
NULL);
|
||||
|
|
@ -6826,7 +6826,7 @@ test_connection_normalize_ovs_interface_type_ovs_interface(gconstpointer test_da
|
|||
case 6:
|
||||
g_object_set(s_con,
|
||||
NM_SETTING_CONNECTION_CONTROLLER,
|
||||
"master0",
|
||||
"controller0",
|
||||
NM_SETTING_CONNECTION_PORT_TYPE,
|
||||
NM_SETTING_OVS_PORT_SETTING_NAME,
|
||||
NULL);
|
||||
|
|
@ -6849,7 +6849,7 @@ test_connection_normalize_ovs_interface_type_ovs_interface(gconstpointer test_da
|
|||
case 7:
|
||||
g_object_set(s_con,
|
||||
NM_SETTING_CONNECTION_CONTROLLER,
|
||||
"master0",
|
||||
"controller0",
|
||||
NM_SETTING_CONNECTION_PORT_TYPE,
|
||||
NM_SETTING_OVS_PORT_SETTING_NAME,
|
||||
NULL);
|
||||
|
|
@ -6861,7 +6861,7 @@ test_connection_normalize_ovs_interface_type_ovs_interface(gconstpointer test_da
|
|||
case 8:
|
||||
g_object_set(s_con,
|
||||
NM_SETTING_CONNECTION_CONTROLLER,
|
||||
"master0",
|
||||
"controller0",
|
||||
NM_SETTING_CONNECTION_PORT_TYPE,
|
||||
NM_SETTING_OVS_PORT_SETTING_NAME,
|
||||
NULL);
|
||||
|
|
@ -6873,7 +6873,7 @@ test_connection_normalize_ovs_interface_type_ovs_interface(gconstpointer test_da
|
|||
case 9:
|
||||
g_object_set(s_con,
|
||||
NM_SETTING_CONNECTION_CONTROLLER,
|
||||
"master0",
|
||||
"controller0",
|
||||
NM_SETTING_CONNECTION_PORT_TYPE,
|
||||
NM_SETTING_OVS_PORT_SETTING_NAME,
|
||||
NULL);
|
||||
|
|
@ -6885,7 +6885,7 @@ test_connection_normalize_ovs_interface_type_ovs_interface(gconstpointer test_da
|
|||
case 10:
|
||||
g_object_set(s_con,
|
||||
NM_SETTING_CONNECTION_CONTROLLER,
|
||||
"master0",
|
||||
"controller0",
|
||||
NM_SETTING_CONNECTION_PORT_TYPE,
|
||||
NM_SETTING_OVS_PORT_SETTING_NAME,
|
||||
NULL);
|
||||
|
|
@ -6898,7 +6898,7 @@ test_connection_normalize_ovs_interface_type_ovs_interface(gconstpointer test_da
|
|||
case 11:
|
||||
g_object_set(s_con,
|
||||
NM_SETTING_CONNECTION_CONTROLLER,
|
||||
"master0",
|
||||
"controller0",
|
||||
NM_SETTING_CONNECTION_PORT_TYPE,
|
||||
NM_SETTING_OVS_PORT_SETTING_NAME,
|
||||
NM_SETTING_CONNECTION_INTERFACE_NAME,
|
||||
|
|
@ -6913,7 +6913,7 @@ test_connection_normalize_ovs_interface_type_ovs_interface(gconstpointer test_da
|
|||
case 12:
|
||||
g_object_set(s_con,
|
||||
NM_SETTING_CONNECTION_CONTROLLER,
|
||||
"master0",
|
||||
"controller0",
|
||||
NM_SETTING_CONNECTION_PORT_TYPE,
|
||||
NM_SETTING_OVS_PORT_SETTING_NAME,
|
||||
NM_SETTING_CONNECTION_INTERFACE_NAME,
|
||||
|
|
@ -10705,7 +10705,7 @@ test_connection_ovs_ifname(gconstpointer test_data)
|
|||
|
||||
g_object_set(s_con,
|
||||
NM_SETTING_CONNECTION_CONTROLLER,
|
||||
"master0",
|
||||
"controller0",
|
||||
NM_SETTING_CONNECTION_PORT_TYPE,
|
||||
NM_SETTING_OVS_BRIDGE_SETTING_NAME,
|
||||
NULL);
|
||||
|
|
@ -10723,7 +10723,7 @@ test_connection_ovs_ifname(gconstpointer test_data)
|
|||
|
||||
g_object_set(s_con,
|
||||
NM_SETTING_CONNECTION_CONTROLLER,
|
||||
"master0",
|
||||
"controller0",
|
||||
NM_SETTING_CONNECTION_PORT_TYPE,
|
||||
NM_SETTING_OVS_PORT_SETTING_NAME,
|
||||
NULL);
|
||||
|
|
@ -10750,7 +10750,7 @@ test_connection_ovs_ifname(gconstpointer test_data)
|
|||
|
||||
g_object_set(s_con,
|
||||
NM_SETTING_CONNECTION_CONTROLLER,
|
||||
"master0",
|
||||
"controller0",
|
||||
NM_SETTING_CONNECTION_PORT_TYPE,
|
||||
NM_SETTING_OVS_PORT_SETTING_NAME,
|
||||
NULL);
|
||||
|
|
@ -10766,7 +10766,7 @@ test_connection_ovs_ifname(gconstpointer test_data)
|
|||
|
||||
g_object_set(s_con,
|
||||
NM_SETTING_CONNECTION_CONTROLLER,
|
||||
"master0",
|
||||
"controller0",
|
||||
NM_SETTING_CONNECTION_PORT_TYPE,
|
||||
NM_SETTING_OVS_PORT_SETTING_NAME,
|
||||
NULL);
|
||||
|
|
@ -10792,7 +10792,7 @@ test_connection_ovs_ifname(gconstpointer test_data)
|
|||
|
||||
g_object_set(s_con,
|
||||
NM_SETTING_CONNECTION_CONTROLLER,
|
||||
"master0",
|
||||
"controller0",
|
||||
NM_SETTING_CONNECTION_PORT_TYPE,
|
||||
NM_SETTING_OVS_PORT_SETTING_NAME,
|
||||
NULL);
|
||||
|
|
|
|||
|
|
@ -857,7 +857,7 @@ test_bridge_port_vlans(void)
|
|||
"id=t\n"
|
||||
"type=dummy\n"
|
||||
"interface-name=dummy1\n"
|
||||
"master=br0\n"
|
||||
"controller=br0\n"
|
||||
"slave-type=bridge\n"
|
||||
"\n"
|
||||
"[bridge-port]\n"
|
||||
|
|
|
|||
|
|
@ -581,7 +581,7 @@ GHashTable *_nm_tc_action_get_attributes(NMTCAction *action);
|
|||
/*****************************************************************************/
|
||||
|
||||
static inline gboolean
|
||||
_nm_connection_type_is_master(const char *type)
|
||||
_nm_connection_type_is_controller(const char *type)
|
||||
{
|
||||
return (NM_IN_STRSET(type,
|
||||
NM_SETTING_BOND_SETTING_NAME,
|
||||
|
|
|
|||
|
|
@ -213,11 +213,11 @@ typedef enum {
|
|||
* @NM_DEVICE_TYPE_MODEM: a modem supporting analog telephone, CDMA/EVDO,
|
||||
* GSM/UMTS, or LTE network access protocols
|
||||
* @NM_DEVICE_TYPE_INFINIBAND: an IP-over-InfiniBand device
|
||||
* @NM_DEVICE_TYPE_BOND: a bond master interface
|
||||
* @NM_DEVICE_TYPE_BOND: a bond controller interface
|
||||
* @NM_DEVICE_TYPE_VLAN: an 802.1Q VLAN interface
|
||||
* @NM_DEVICE_TYPE_ADSL: ADSL modem
|
||||
* @NM_DEVICE_TYPE_BRIDGE: a bridge master interface
|
||||
* @NM_DEVICE_TYPE_TEAM: a team master interface
|
||||
* @NM_DEVICE_TYPE_BRIDGE: a bridge controller interface
|
||||
* @NM_DEVICE_TYPE_TEAM: a team controller interface
|
||||
* @NM_DEVICE_TYPE_TUN: a TUN or TAP interface
|
||||
* @NM_DEVICE_TYPE_IP_TUNNEL: a IP tunnel interface
|
||||
* @NM_DEVICE_TYPE_MACVLAN: a MACVLAN interface
|
||||
|
|
@ -1091,13 +1091,13 @@ typedef enum /*< flags >*/ {
|
|||
/**
|
||||
* NMActivationStateFlags:
|
||||
* @NM_ACTIVATION_STATE_FLAG_NONE: an alias for numeric zero, no flags set.
|
||||
* @NM_ACTIVATION_STATE_FLAG_IS_MASTER: the device is a master.
|
||||
* @NM_ACTIVATION_STATE_FLAG_IS_MASTER: the device is a controller.
|
||||
* @NM_ACTIVATION_STATE_FLAG_IS_SLAVE: the device is a slave.
|
||||
* @NM_ACTIVATION_STATE_FLAG_LAYER2_READY: layer2 is activated and ready.
|
||||
* @NM_ACTIVATION_STATE_FLAG_IP4_READY: IPv4 setting is completed.
|
||||
* @NM_ACTIVATION_STATE_FLAG_IP6_READY: IPv6 setting is completed.
|
||||
* @NM_ACTIVATION_STATE_FLAG_MASTER_HAS_SLAVES: The master has any slave devices attached.
|
||||
* This only makes sense if the device is a master.
|
||||
* @NM_ACTIVATION_STATE_FLAG_MASTER_HAS_SLAVES: The controller has any slave devices attached.
|
||||
* This only makes sense if the device is a controller.
|
||||
* @NM_ACTIVATION_STATE_FLAG_LIFETIME_BOUND_TO_PROFILE_VISIBILITY: the lifetime
|
||||
* of the activation is bound to the visibility of the connection profile,
|
||||
* which in turn depends on "connection.permissions" and whether a session
|
||||
|
|
|
|||
|
|
@ -71,12 +71,12 @@ G_BEGIN_DECLS
|
|||
* NMSettingConnectionAutoconnectSlaves:
|
||||
* @NM_SETTING_CONNECTION_AUTOCONNECT_SLAVES_DEFAULT: default value
|
||||
* @NM_SETTING_CONNECTION_AUTOCONNECT_SLAVES_NO: slaves are not brought up when
|
||||
* master is activated
|
||||
* controller is activated
|
||||
* @NM_SETTING_CONNECTION_AUTOCONNECT_SLAVES_YES: slaves are brought up when
|
||||
* master is activated
|
||||
* controller is activated
|
||||
*
|
||||
* #NMSettingConnectionAutoconnectSlaves values indicate whether slave connections
|
||||
* should be activated when master is activated.
|
||||
* should be activated when controller is activated.
|
||||
*
|
||||
* Since: 1.2
|
||||
*
|
||||
|
|
|
|||
|
|
@ -155,12 +155,12 @@ typedef enum {
|
|||
#define _NM_LINK_TYPE_SW_LAST NM_LINK_TYPE_WIREGUARD
|
||||
|
||||
/* Software types with slaves */
|
||||
#define _NM_LINK_TYPE_SW_MASTER_FIRST NM_LINK_TYPE_BRIDGE
|
||||
#define _NM_LINK_TYPE_SW_CONTROLLER_FIRST NM_LINK_TYPE_BRIDGE
|
||||
NM_LINK_TYPE_BRIDGE,
|
||||
NM_LINK_TYPE_BOND,
|
||||
NM_LINK_TYPE_HSR,
|
||||
NM_LINK_TYPE_TEAM,
|
||||
#define _NM_LINK_TYPE_SW_MASTER_LAST NM_LINK_TYPE_TEAM
|
||||
#define _NM_LINK_TYPE_SW_CONTROLLER_LAST NM_LINK_TYPE_TEAM
|
||||
|
||||
#define _NM_LINK_TYPE_REAL_LAST NM_LINK_TYPE_TEAM
|
||||
|
||||
|
|
@ -171,15 +171,16 @@ typedef enum {
|
|||
static inline gboolean
|
||||
nm_link_type_is_software(NMLinkType link_type)
|
||||
{
|
||||
G_STATIC_ASSERT(_NM_LINK_TYPE_SW_LAST + 1 == _NM_LINK_TYPE_SW_MASTER_FIRST);
|
||||
G_STATIC_ASSERT(_NM_LINK_TYPE_SW_LAST + 1 == _NM_LINK_TYPE_SW_CONTROLLER_FIRST);
|
||||
|
||||
return link_type >= _NM_LINK_TYPE_SW_FIRST && link_type <= _NM_LINK_TYPE_SW_MASTER_LAST;
|
||||
return link_type >= _NM_LINK_TYPE_SW_FIRST && link_type <= _NM_LINK_TYPE_SW_CONTROLLER_LAST;
|
||||
}
|
||||
|
||||
static inline gboolean
|
||||
nm_link_type_supports_slaves(NMLinkType link_type)
|
||||
{
|
||||
return link_type >= _NM_LINK_TYPE_SW_MASTER_FIRST && link_type <= _NM_LINK_TYPE_SW_MASTER_LAST;
|
||||
return link_type >= _NM_LINK_TYPE_SW_CONTROLLER_FIRST
|
||||
&& link_type <= _NM_LINK_TYPE_SW_CONTROLLER_LAST;
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
|
|
|||
|
|
@ -161,6 +161,10 @@ typedef enum _nm_packed {
|
|||
#define __IFLA_TUN_MAX 10
|
||||
#define IFLA_TUN_MAX (__IFLA_TUN_MAX - 1)
|
||||
|
||||
#define IFLA_CONTROLLER IFLA_MASTER
|
||||
|
||||
#define BRIDGE_FLAGS_CONTROLLER BRIDGE_FLAGS_MASTER
|
||||
|
||||
G_STATIC_ASSERT(RTA_MAX == (__RTA_MAX - 1));
|
||||
#define RTA_PREF 20
|
||||
#undef RTA_MAX
|
||||
|
|
@ -432,7 +436,7 @@ typedef enum _nm_packed {
|
|||
DELAYED_ACTION_TYPE_WAIT_FOR_RESPONSE_RTNL = 1 << 12,
|
||||
DELAYED_ACTION_TYPE_WAIT_FOR_RESPONSE_GENL = 1 << 13,
|
||||
DELAYED_ACTION_TYPE_REFRESH_LINK = 1 << 14,
|
||||
DELAYED_ACTION_TYPE_MASTER_CONNECTED = 1 << 15,
|
||||
DELAYED_ACTION_TYPE_CONTROLLER_CONNECTED = 1 << 15,
|
||||
|
||||
__DELAYED_ACTION_TYPE_MAX,
|
||||
|
||||
|
|
@ -559,7 +563,7 @@ typedef struct {
|
|||
* by type. */
|
||||
int refresh_all_in_progress[_REFRESH_ALL_TYPE_NUM];
|
||||
|
||||
GPtrArray *list_master_connected;
|
||||
GPtrArray *list_controller_connected;
|
||||
GPtrArray *list_refresh_link;
|
||||
union {
|
||||
struct {
|
||||
|
|
@ -3377,7 +3381,7 @@ _new_from_nl_link(NMPlatform *platform,
|
|||
[IFLA_GRO_MAX_SIZE] = {.type = NLA_U32},
|
||||
[IFLA_LINK] = {.type = NLA_U32},
|
||||
[IFLA_WEIGHT] = {.type = NLA_U32},
|
||||
[IFLA_MASTER] = {.type = NLA_U32},
|
||||
[IFLA_CONTROLLER] = {.type = NLA_U32},
|
||||
[IFLA_OPERSTATE] = {.type = NLA_U8},
|
||||
[IFLA_LINKMODE] = {.type = NLA_U8},
|
||||
[IFLA_LINKINFO] = {.type = NLA_NESTED},
|
||||
|
|
@ -3577,8 +3581,8 @@ _new_from_nl_link(NMPlatform *platform,
|
|||
&link_cached,
|
||||
&obj->link.kind);
|
||||
|
||||
if (tb[IFLA_MASTER])
|
||||
obj->link.master = nla_get_u32(tb[IFLA_MASTER]);
|
||||
if (tb[IFLA_CONTROLLER])
|
||||
obj->link.controller = nla_get_u32(tb[IFLA_CONTROLLER]);
|
||||
|
||||
if (tb[IFLA_LINK]) {
|
||||
if (!tb[IFLA_LINK_NETNSID])
|
||||
|
|
@ -6781,7 +6785,7 @@ static NM_UTILS_LOOKUP_STR_DEFINE(
|
|||
NM_UTILS_LOOKUP_STR_ITEM(DELAYED_ACTION_TYPE_REFRESH_ALL_GENL_FAMILIES,
|
||||
"refresh-all-genl-families"),
|
||||
NM_UTILS_LOOKUP_STR_ITEM(DELAYED_ACTION_TYPE_REFRESH_LINK, "refresh-link"),
|
||||
NM_UTILS_LOOKUP_STR_ITEM(DELAYED_ACTION_TYPE_MASTER_CONNECTED, "master-connected"),
|
||||
NM_UTILS_LOOKUP_STR_ITEM(DELAYED_ACTION_TYPE_CONTROLLER_CONNECTED, "controller-connected"),
|
||||
NM_UTILS_LOOKUP_STR_ITEM(DELAYED_ACTION_TYPE_READ_RTNL, "read-rtnl"),
|
||||
NM_UTILS_LOOKUP_STR_ITEM(DELAYED_ACTION_TYPE_READ_GENL, "read-genl"),
|
||||
NM_UTILS_LOOKUP_STR_ITEM(DELAYED_ACTION_TYPE_WAIT_FOR_RESPONSE_RTNL, "wait-for-response-rtnl"),
|
||||
|
|
@ -6809,8 +6813,8 @@ delayed_action_to_string_full(DelayedActionType action_type,
|
|||
nm_strbuf_append_str(&buf, &buf_size, delayed_action_to_string(action_type));
|
||||
|
||||
switch (action_type) {
|
||||
case DELAYED_ACTION_TYPE_MASTER_CONNECTED:
|
||||
nm_strbuf_append(&buf, &buf_size, " (master-ifindex %d)", GPOINTER_TO_INT(user_data));
|
||||
case DELAYED_ACTION_TYPE_CONTROLLER_CONNECTED:
|
||||
nm_strbuf_append(&buf, &buf_size, " (controller-ifindex %d)", GPOINTER_TO_INT(user_data));
|
||||
break;
|
||||
case DELAYED_ACTION_TYPE_REFRESH_LINK:
|
||||
nm_strbuf_append(&buf, &buf_size, " (ifindex %d)", GPOINTER_TO_INT(user_data));
|
||||
|
|
@ -6991,16 +6995,16 @@ delayed_action_wait_for_nl_response_complete_all(NMPlatform *platfor
|
|||
/*****************************************************************************/
|
||||
|
||||
static void
|
||||
delayed_action_handle_MASTER_CONNECTED(NMPlatform *platform, int master_ifindex)
|
||||
delayed_action_handle_CONTROLLER_CONNECTED(NMPlatform *platform, int controller_ifindex)
|
||||
{
|
||||
nm_auto_nmpobj const NMPObject *obj_old = NULL;
|
||||
nm_auto_nmpobj const NMPObject *obj_new = NULL;
|
||||
NMPCacheOpsType cache_op;
|
||||
|
||||
cache_op = nmp_cache_update_link_master_connected(nm_platform_get_cache(platform),
|
||||
master_ifindex,
|
||||
&obj_old,
|
||||
&obj_new);
|
||||
cache_op = nmp_cache_update_link_controller_connected(nm_platform_get_cache(platform),
|
||||
controller_ifindex,
|
||||
&obj_old,
|
||||
&obj_new);
|
||||
if (cache_op == NMP_CACHE_OPS_UNCHANGED)
|
||||
return;
|
||||
cache_on_change(platform, cache_op, obj_old, obj_new);
|
||||
|
|
@ -7042,27 +7046,27 @@ delayed_action_handle_one(NMPlatform *platform)
|
|||
if (priv->delayed_action.flags == DELAYED_ACTION_TYPE_NONE)
|
||||
return FALSE;
|
||||
|
||||
/* First process DELAYED_ACTION_TYPE_MASTER_CONNECTED actions.
|
||||
/* First process DELAYED_ACTION_TYPE_CONTROLLER_CONNECTED actions.
|
||||
* This type of action is entirely cache-internal and is here to resolve a
|
||||
* cache inconsistency. It should be fixed right away. */
|
||||
if (NM_FLAGS_HAS(priv->delayed_action.flags, DELAYED_ACTION_TYPE_MASTER_CONNECTED)) {
|
||||
nm_assert(priv->delayed_action.list_master_connected->len > 0);
|
||||
if (NM_FLAGS_HAS(priv->delayed_action.flags, DELAYED_ACTION_TYPE_CONTROLLER_CONNECTED)) {
|
||||
nm_assert(priv->delayed_action.list_controller_connected->len > 0);
|
||||
|
||||
user_data = priv->delayed_action.list_master_connected->pdata[0];
|
||||
g_ptr_array_remove_index_fast(priv->delayed_action.list_master_connected, 0);
|
||||
if (priv->delayed_action.list_master_connected->len == 0)
|
||||
priv->delayed_action.flags &= ~DELAYED_ACTION_TYPE_MASTER_CONNECTED;
|
||||
user_data = priv->delayed_action.list_controller_connected->pdata[0];
|
||||
g_ptr_array_remove_index_fast(priv->delayed_action.list_controller_connected, 0);
|
||||
if (priv->delayed_action.list_controller_connected->len == 0)
|
||||
priv->delayed_action.flags &= ~DELAYED_ACTION_TYPE_CONTROLLER_CONNECTED;
|
||||
nm_assert(nm_utils_ptrarray_find_first(
|
||||
(gconstpointer *) priv->delayed_action.list_master_connected->pdata,
|
||||
priv->delayed_action.list_master_connected->len,
|
||||
(gconstpointer *) priv->delayed_action.list_controller_connected->pdata,
|
||||
priv->delayed_action.list_controller_connected->len,
|
||||
user_data)
|
||||
< 0);
|
||||
|
||||
_LOGt_delayed_action(DELAYED_ACTION_TYPE_MASTER_CONNECTED, user_data, "handle");
|
||||
delayed_action_handle_MASTER_CONNECTED(platform, GPOINTER_TO_INT(user_data));
|
||||
_LOGt_delayed_action(DELAYED_ACTION_TYPE_CONTROLLER_CONNECTED, user_data, "handle");
|
||||
delayed_action_handle_CONTROLLER_CONNECTED(platform, GPOINTER_TO_INT(user_data));
|
||||
return TRUE;
|
||||
}
|
||||
nm_assert(priv->delayed_action.list_master_connected->len == 0);
|
||||
nm_assert(priv->delayed_action.list_controller_connected->len == 0);
|
||||
|
||||
/* Next we prefer read-genl/read-rtnl, because the buffer size is limited and we want to process events
|
||||
* from netlink early. */
|
||||
|
|
@ -7178,13 +7182,13 @@ delayed_action_schedule(NMPlatform *platform, DelayedActionType action_type, gpo
|
|||
< 0)
|
||||
g_ptr_array_add(priv->delayed_action.list_refresh_link, user_data);
|
||||
break;
|
||||
case DELAYED_ACTION_TYPE_MASTER_CONNECTED:
|
||||
case DELAYED_ACTION_TYPE_CONTROLLER_CONNECTED:
|
||||
if (nm_utils_ptrarray_find_first(
|
||||
(gconstpointer *) priv->delayed_action.list_master_connected->pdata,
|
||||
priv->delayed_action.list_master_connected->len,
|
||||
(gconstpointer *) priv->delayed_action.list_controller_connected->pdata,
|
||||
priv->delayed_action.list_controller_connected->len,
|
||||
user_data)
|
||||
< 0)
|
||||
g_ptr_array_add(priv->delayed_action.list_master_connected, user_data);
|
||||
g_ptr_array_add(priv->delayed_action.list_controller_connected, user_data);
|
||||
break;
|
||||
case DELAYED_ACTION_TYPE_WAIT_FOR_RESPONSE_RTNL:
|
||||
g_array_append_vals(priv->delayed_action.list_wait_for_response_rtnl, user_data, 1);
|
||||
|
|
@ -7198,7 +7202,7 @@ delayed_action_schedule(NMPlatform *platform, DelayedActionType action_type, gpo
|
|||
nm_assert(!user_data);
|
||||
nm_assert(!NM_FLAGS_ANY(action_type,
|
||||
DELAYED_ACTION_TYPE_REFRESH_LINK
|
||||
| DELAYED_ACTION_TYPE_MASTER_CONNECTED
|
||||
| DELAYED_ACTION_TYPE_CONTROLLER_CONNECTED
|
||||
| DELAYED_ACTION_TYPE_WAIT_FOR_RESPONSE_RTNL
|
||||
| DELAYED_ACTION_TYPE_WAIT_FOR_RESPONSE_GENL));
|
||||
break;
|
||||
|
|
@ -7365,30 +7369,30 @@ cache_on_change(NMPlatform *platform,
|
|||
switch (klass->obj_type) {
|
||||
case NMP_OBJECT_TYPE_LINK:
|
||||
{
|
||||
/* check whether changing a slave link can cause a master link (bridge or bond) to go up/down */
|
||||
/* check whether changing a slave 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.master,
|
||||
obj_old->link.controller,
|
||||
obj_new,
|
||||
obj_old))
|
||||
delayed_action_schedule(platform,
|
||||
DELAYED_ACTION_TYPE_MASTER_CONNECTED,
|
||||
GINT_TO_POINTER(obj_old->link.master));
|
||||
if (obj_new && (!obj_old || obj_old->link.master != obj_new->link.master)
|
||||
DELAYED_ACTION_TYPE_CONTROLLER_CONNECTED,
|
||||
GINT_TO_POINTER(obj_old->link.controller));
|
||||
if (obj_new && (!obj_old || obj_old->link.controller != obj_new->link.controller)
|
||||
&& nmp_cache_link_connected_needs_toggle_by_ifindex(cache,
|
||||
obj_new->link.master,
|
||||
obj_new->link.controller,
|
||||
obj_new,
|
||||
obj_old))
|
||||
delayed_action_schedule(platform,
|
||||
DELAYED_ACTION_TYPE_MASTER_CONNECTED,
|
||||
GINT_TO_POINTER(obj_new->link.master));
|
||||
DELAYED_ACTION_TYPE_CONTROLLER_CONNECTED,
|
||||
GINT_TO_POINTER(obj_new->link.controller));
|
||||
}
|
||||
{
|
||||
/* check whether we are about to change a master link that needs toggling connected state. */
|
||||
/* check whether we are about to change a controller link that needs toggling connected state. */
|
||||
if (obj_new /* <-- nonsensical, make coverity happy */
|
||||
&& nmp_cache_link_connected_needs_toggle(cache, obj_new, obj_new, obj_old))
|
||||
delayed_action_schedule(platform,
|
||||
DELAYED_ACTION_TYPE_MASTER_CONNECTED,
|
||||
DELAYED_ACTION_TYPE_CONTROLLER_CONNECTED,
|
||||
GINT_TO_POINTER(obj_new->link.ifindex));
|
||||
}
|
||||
{
|
||||
|
|
@ -7527,16 +7531,16 @@ cache_on_change(NMPlatform *platform,
|
|||
}
|
||||
}
|
||||
{
|
||||
/* on enslave/release, we also refresh the master. */
|
||||
/* on enslave/release, we also refresh the controller. */
|
||||
int ifindex1 = 0, ifindex2 = 0;
|
||||
gboolean changed_master, changed_connected;
|
||||
gboolean changed_controller, changed_connected;
|
||||
|
||||
changed_master =
|
||||
(obj_new && obj_new->_link.netlink.is_in_netlink && obj_new->link.master > 0
|
||||
? obj_new->link.master
|
||||
changed_controller =
|
||||
(obj_new && obj_new->_link.netlink.is_in_netlink && obj_new->link.controller > 0
|
||||
? obj_new->link.controller
|
||||
: 0)
|
||||
!= (obj_old && obj_old->_link.netlink.is_in_netlink && obj_old->link.master > 0
|
||||
? obj_old->link.master
|
||||
!= (obj_old && obj_old->_link.netlink.is_in_netlink && obj_old->link.controller > 0
|
||||
? obj_old->link.controller
|
||||
: 0);
|
||||
changed_connected = (obj_new && obj_new->_link.netlink.is_in_netlink
|
||||
? NM_FLAGS_HAS(obj_new->link.n_ifi_flags, IFF_LOWER_UP)
|
||||
|
|
@ -7545,15 +7549,15 @@ cache_on_change(NMPlatform *platform,
|
|||
? NM_FLAGS_HAS(obj_old->link.n_ifi_flags, IFF_LOWER_UP)
|
||||
: 2);
|
||||
|
||||
if (changed_master || changed_connected) {
|
||||
ifindex1 =
|
||||
(obj_old && obj_old->_link.netlink.is_in_netlink && obj_old->link.master > 0)
|
||||
? obj_old->link.master
|
||||
: 0;
|
||||
ifindex2 =
|
||||
(obj_new && obj_new->_link.netlink.is_in_netlink && obj_new->link.master > 0)
|
||||
? obj_new->link.master
|
||||
: 0;
|
||||
if (changed_controller || changed_connected) {
|
||||
ifindex1 = (obj_old && obj_old->_link.netlink.is_in_netlink
|
||||
&& obj_old->link.controller > 0)
|
||||
? obj_old->link.controller
|
||||
: 0;
|
||||
ifindex2 = (obj_new && obj_new->_link.netlink.is_in_netlink
|
||||
&& obj_new->link.controller > 0)
|
||||
? obj_new->link.controller
|
||||
: 0;
|
||||
|
||||
if (ifindex1 > 0)
|
||||
delayed_action_schedule(platform,
|
||||
|
|
@ -8664,13 +8668,13 @@ link_add(NMPlatform *platform,
|
|||
|
||||
if (type == NM_LINK_TYPE_BOND) {
|
||||
/* When the kernel loads the bond module, either via explicit modprobe
|
||||
* or automatically in response to creating a bond master, it will also
|
||||
* or automatically in response to creating a bond controller, it will also
|
||||
* create a 'bond0' interface. Since the bond we're about to create may
|
||||
* or may not be named 'bond0' prevent potential confusion about a bond
|
||||
* that the user didn't want by telling the bonding module not to create
|
||||
* bond0 automatically.
|
||||
*/
|
||||
if (!g_file_test("/sys/class/net/bonding_masters", G_FILE_TEST_EXISTS))
|
||||
if (!g_file_test("/sys/class/net/bonding_controllers", G_FILE_TEST_EXISTS))
|
||||
(void) nmp_utils_modprobe(NULL, TRUE, "bonding", "max_bonds=0", NULL);
|
||||
}
|
||||
|
||||
|
|
@ -9494,7 +9498,7 @@ nla_put_failure:
|
|||
static gboolean
|
||||
link_set_bridge_vlans(NMPlatform *platform,
|
||||
int ifindex,
|
||||
gboolean on_master,
|
||||
gboolean on_controller,
|
||||
const NMPlatformBridgeVlan *const *vlans)
|
||||
{
|
||||
nm_auto_nlmsg struct nl_msg *nlmsg = NULL;
|
||||
|
|
@ -9516,7 +9520,9 @@ link_set_bridge_vlans(NMPlatform *platform,
|
|||
if (!(list = nla_nest_start(nlmsg, IFLA_AF_SPEC)))
|
||||
goto nla_put_failure;
|
||||
|
||||
NLA_PUT_U16(nlmsg, IFLA_BRIDGE_FLAGS, on_master ? BRIDGE_FLAGS_MASTER : BRIDGE_FLAGS_SELF);
|
||||
NLA_PUT_U16(nlmsg,
|
||||
IFLA_BRIDGE_FLAGS,
|
||||
on_controller ? BRIDGE_FLAGS_CONTROLLER : BRIDGE_FLAGS_SELF);
|
||||
|
||||
if (vlans) {
|
||||
/* Add VLANs */
|
||||
|
|
@ -9821,7 +9827,7 @@ link_vlan_change(NMPlatform *platform,
|
|||
}
|
||||
|
||||
static gboolean
|
||||
link_enslave(NMPlatform *platform, int master, int slave)
|
||||
link_enslave(NMPlatform *platform, int controller, int slave)
|
||||
{
|
||||
nm_auto_nlmsg struct nl_msg *nlmsg = NULL;
|
||||
int ifindex = slave;
|
||||
|
|
@ -9830,7 +9836,7 @@ link_enslave(NMPlatform *platform, int master, int slave)
|
|||
if (!nlmsg)
|
||||
return FALSE;
|
||||
|
||||
NLA_PUT_U32(nlmsg, IFLA_MASTER, master);
|
||||
NLA_PUT_U32(nlmsg, IFLA_CONTROLLER, controller);
|
||||
|
||||
return (do_change_link(platform, CHANGE_LINK_TYPE_UNSPEC, ifindex, nlmsg, NULL) >= 0);
|
||||
nla_put_failure:
|
||||
|
|
@ -9838,7 +9844,7 @@ nla_put_failure:
|
|||
}
|
||||
|
||||
static gboolean
|
||||
link_release(NMPlatform *platform, int master, int slave)
|
||||
link_release(NMPlatform *platform, int controller, int slave)
|
||||
{
|
||||
return link_enslave(platform, 0, slave);
|
||||
}
|
||||
|
|
@ -10070,7 +10076,7 @@ link_can_assume(NMPlatform *platform, int ifindex)
|
|||
if (!NM_FLAGS_HAS(link->link.n_ifi_flags, IFF_UP))
|
||||
return FALSE;
|
||||
|
||||
if (link->link.master > 0)
|
||||
if (link->link.controller > 0)
|
||||
return TRUE;
|
||||
|
||||
nmp_lookup_init_object_by_ifindex(&lookup, NMP_OBJECT_TYPE_IP4_ADDRESS, ifindex);
|
||||
|
|
@ -11605,8 +11611,8 @@ nm_linux_platform_init(NMLinuxPlatform *self)
|
|||
c_list_init(&priv->sysctl_clear_cache_lst);
|
||||
c_list_init(&priv->sysctl_list);
|
||||
|
||||
priv->delayed_action.list_master_connected = g_ptr_array_new();
|
||||
priv->delayed_action.list_refresh_link = g_ptr_array_new();
|
||||
priv->delayed_action.list_controller_connected = g_ptr_array_new();
|
||||
priv->delayed_action.list_refresh_link = g_ptr_array_new();
|
||||
priv->delayed_action.list_wait_for_response_rtnl =
|
||||
g_array_new(FALSE, TRUE, sizeof(DelayedActionWaitForNlResponseData));
|
||||
priv->delayed_action.list_wait_for_response_genl =
|
||||
|
|
@ -11819,7 +11825,7 @@ dispose(GObject *object)
|
|||
WAIT_FOR_NL_RESPONSE_RESULT_FAILED_DISPOSING);
|
||||
|
||||
priv->delayed_action.flags = DELAYED_ACTION_TYPE_NONE;
|
||||
g_ptr_array_set_size(priv->delayed_action.list_master_connected, 0);
|
||||
g_ptr_array_set_size(priv->delayed_action.list_controller_connected, 0);
|
||||
g_ptr_array_set_size(priv->delayed_action.list_refresh_link, 0);
|
||||
|
||||
G_OBJECT_CLASS(nm_linux_platform_parent_class)->dispose(object);
|
||||
|
|
@ -11830,7 +11836,7 @@ finalize(GObject *object)
|
|||
{
|
||||
NMLinuxPlatformPrivate *priv = NM_LINUX_PLATFORM_GET_PRIVATE(object);
|
||||
|
||||
g_ptr_array_unref(priv->delayed_action.list_master_connected);
|
||||
g_ptr_array_unref(priv->delayed_action.list_controller_connected);
|
||||
g_ptr_array_unref(priv->delayed_action.list_refresh_link);
|
||||
g_array_unref(priv->delayed_action.list_wait_for_response_rtnl);
|
||||
g_array_unref(priv->delayed_action.list_wait_for_response_genl);
|
||||
|
|
|
|||
|
|
@ -1074,10 +1074,10 @@ nm_platform_link_get_all(NMPlatform *self)
|
|||
|
||||
if (!item->ifindex)
|
||||
continue;
|
||||
if (item->master != 0) {
|
||||
g_warn_if_fail(item->master > 0);
|
||||
g_warn_if_fail(item->master != item->ifindex);
|
||||
g_warn_if_fail(g_hash_table_contains(unseen, GINT_TO_POINTER(item->master)));
|
||||
if (item->controller != 0) {
|
||||
g_warn_if_fail(item->controller > 0);
|
||||
g_warn_if_fail(item->controller != item->ifindex);
|
||||
g_warn_if_fail(g_hash_table_contains(unseen, GINT_TO_POINTER(item->controller)));
|
||||
}
|
||||
if (item->parent != 0) {
|
||||
if (item->parent != NM_PLATFORM_LINK_OTHER_NETNS) {
|
||||
|
|
@ -1106,7 +1106,8 @@ nm_platform_link_get_all(NMPlatform *self)
|
|||
|
||||
g_assert(g_hash_table_contains(unseen, GINT_TO_POINTER(item->ifindex)));
|
||||
|
||||
if (item->master > 0 && g_hash_table_contains(unseen, GINT_TO_POINTER(item->master)))
|
||||
if (item->controller > 0
|
||||
&& g_hash_table_contains(unseen, GINT_TO_POINTER(item->controller)))
|
||||
goto skip;
|
||||
if (item->parent > 0 && g_hash_table_contains(unseen, GINT_TO_POINTER(item->parent)))
|
||||
goto skip;
|
||||
|
|
@ -2071,7 +2072,7 @@ nm_platform_link_set_sriov_vfs(NMPlatform *self, int ifindex, const NMPlatformVF
|
|||
gboolean
|
||||
nm_platform_link_set_bridge_vlans(NMPlatform *self,
|
||||
int ifindex,
|
||||
gboolean on_master,
|
||||
gboolean on_controller,
|
||||
const NMPlatformBridgeVlan *const *vlans)
|
||||
{
|
||||
guint i;
|
||||
|
|
@ -2082,7 +2083,7 @@ nm_platform_link_set_bridge_vlans(NMPlatform *self,
|
|||
if (_LOGD_ENABLED()) {
|
||||
_LOG3D("link: %s bridge VLANs on %s",
|
||||
vlans ? "setting" : "clearing",
|
||||
on_master ? "master" : "self");
|
||||
on_controller ? "controller" : "self");
|
||||
if (vlans) {
|
||||
for (i = 0; vlans[i]; i++) {
|
||||
char sbuf[NM_UTILS_TO_STRING_BUFFER_SIZE];
|
||||
|
|
@ -2094,7 +2095,7 @@ nm_platform_link_set_bridge_vlans(NMPlatform *self,
|
|||
}
|
||||
}
|
||||
|
||||
return klass->link_set_bridge_vlans(self, ifindex, on_master, vlans);
|
||||
return klass->link_set_bridge_vlans(self, ifindex, on_controller, vlans);
|
||||
}
|
||||
|
||||
gboolean
|
||||
|
|
@ -2378,63 +2379,63 @@ nm_platform_link_get_driver_info(NMPlatform *self,
|
|||
/**
|
||||
* nm_platform_link_enslave:
|
||||
* @self: platform instance
|
||||
* @master: Interface index of the master
|
||||
* @controller: Interface index of the controller
|
||||
* @ifindex: Interface index of the slave
|
||||
*
|
||||
* Enslave @ifindex to @master.
|
||||
* Enslave @ifindex to @controller.
|
||||
*/
|
||||
gboolean
|
||||
nm_platform_link_enslave(NMPlatform *self, int master, int ifindex)
|
||||
nm_platform_link_enslave(NMPlatform *self, int controller, int ifindex)
|
||||
{
|
||||
_CHECK_SELF(self, klass, FALSE);
|
||||
|
||||
g_return_val_if_fail(master > 0, FALSE);
|
||||
g_return_val_if_fail(controller > 0, FALSE);
|
||||
g_return_val_if_fail(ifindex > 0, FALSE);
|
||||
|
||||
_LOG3D("link: enslaving to master '%s'", nm_platform_link_get_name(self, master));
|
||||
return klass->link_enslave(self, master, ifindex);
|
||||
_LOG3D("link: enslaving to controller '%s'", nm_platform_link_get_name(self, controller));
|
||||
return klass->link_enslave(self, controller, ifindex);
|
||||
}
|
||||
|
||||
/**
|
||||
* nm_platform_link_release:
|
||||
* @self: platform instance
|
||||
* @master: Interface index of the master
|
||||
* @controller: Interface index of the controller
|
||||
* @ifindex: Interface index of the slave
|
||||
*
|
||||
* Release @slave from @master.
|
||||
* Release @slave from @controller.
|
||||
*/
|
||||
gboolean
|
||||
nm_platform_link_release(NMPlatform *self, int master, int ifindex)
|
||||
nm_platform_link_release(NMPlatform *self, int controller, int ifindex)
|
||||
{
|
||||
_CHECK_SELF(self, klass, FALSE);
|
||||
|
||||
g_return_val_if_fail(master > 0, FALSE);
|
||||
g_return_val_if_fail(controller > 0, FALSE);
|
||||
g_return_val_if_fail(ifindex > 0, FALSE);
|
||||
|
||||
if (nm_platform_link_get_master(self, ifindex) != master)
|
||||
if (nm_platform_link_get_controller(self, ifindex) != controller)
|
||||
return FALSE;
|
||||
|
||||
_LOG3D("link: releasing %d from master '%s' (%d)",
|
||||
_LOG3D("link: releasing %d from controller '%s' (%d)",
|
||||
ifindex,
|
||||
nm_platform_link_get_name(self, master),
|
||||
master);
|
||||
return klass->link_release(self, master, ifindex);
|
||||
nm_platform_link_get_name(self, controller),
|
||||
controller);
|
||||
return klass->link_release(self, controller, ifindex);
|
||||
}
|
||||
|
||||
/**
|
||||
* nm_platform_link_get_master:
|
||||
* nm_platform_link_get_controller:
|
||||
* @self: platform instance
|
||||
* @slave: Interface index of the slave.
|
||||
*
|
||||
* Returns: Interface index of the slave's master.
|
||||
* Returns: Interface index of the slave's controller.
|
||||
*/
|
||||
int
|
||||
nm_platform_link_get_master(NMPlatform *self, int slave)
|
||||
nm_platform_link_get_controller(NMPlatform *self, int slave)
|
||||
{
|
||||
const NMPlatformLink *pllink;
|
||||
|
||||
pllink = nm_platform_link_get(self, slave);
|
||||
return pllink ? pllink->master : 0;
|
||||
return pllink ? pllink->controller : 0;
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
|
@ -2852,9 +2853,9 @@ link_get_option(NMPlatform *self, int ifindex, const char *category, const char
|
|||
}
|
||||
|
||||
static const char *
|
||||
master_category(NMPlatform *self, int master)
|
||||
controller_category(NMPlatform *self, int controller)
|
||||
{
|
||||
switch (nm_platform_link_get_type(self, master)) {
|
||||
switch (nm_platform_link_get_type(self, controller)) {
|
||||
case NM_LINK_TYPE_BRIDGE:
|
||||
return "bridge";
|
||||
case NM_LINK_TYPE_BOND:
|
||||
|
|
@ -2867,12 +2868,12 @@ master_category(NMPlatform *self, int master)
|
|||
static const char *
|
||||
slave_category(NMPlatform *self, int slave)
|
||||
{
|
||||
int master = nm_platform_link_get_master(self, slave);
|
||||
int controller = nm_platform_link_get_controller(self, slave);
|
||||
|
||||
if (master <= 0)
|
||||
if (controller <= 0)
|
||||
return NULL;
|
||||
|
||||
switch (nm_platform_link_get_type(self, master)) {
|
||||
switch (nm_platform_link_get_type(self, controller)) {
|
||||
case NM_LINK_TYPE_BRIDGE:
|
||||
return "brport";
|
||||
case NM_LINK_TYPE_BOND:
|
||||
|
|
@ -2883,10 +2884,10 @@ slave_category(NMPlatform *self, int slave)
|
|||
}
|
||||
|
||||
gboolean
|
||||
nm_platform_sysctl_master_set_option(NMPlatform *self,
|
||||
int ifindex,
|
||||
const char *option,
|
||||
const char *value)
|
||||
nm_platform_sysctl_controller_set_option(NMPlatform *self,
|
||||
int ifindex,
|
||||
const char *option,
|
||||
const char *value)
|
||||
{
|
||||
_CHECK_SELF(self, klass, FALSE);
|
||||
|
||||
|
|
@ -2894,18 +2895,18 @@ nm_platform_sysctl_master_set_option(NMPlatform *self,
|
|||
g_return_val_if_fail(option, FALSE);
|
||||
g_return_val_if_fail(value, FALSE);
|
||||
|
||||
return link_set_option(self, ifindex, master_category(self, ifindex), option, value);
|
||||
return link_set_option(self, ifindex, controller_category(self, ifindex), option, value);
|
||||
}
|
||||
|
||||
char *
|
||||
nm_platform_sysctl_master_get_option(NMPlatform *self, int ifindex, const char *option)
|
||||
nm_platform_sysctl_controller_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, master_category(self, ifindex), option);
|
||||
return link_get_option(self, ifindex, controller_category(self, ifindex), option);
|
||||
}
|
||||
|
||||
gboolean
|
||||
|
|
@ -4866,8 +4867,8 @@ nm_platform_ip_route_get_prune_list(NMPlatform *self,
|
|||
return NULL;
|
||||
|
||||
lnk_vrf = nm_platform_link_get_lnk_vrf(self, ifindex, &pllink);
|
||||
if (!lnk_vrf && pllink && pllink->master > 0)
|
||||
lnk_vrf = nm_platform_link_get_lnk_vrf(self, pllink->master, NULL);
|
||||
if (!lnk_vrf && pllink && pllink->controller > 0)
|
||||
lnk_vrf = nm_platform_link_get_lnk_vrf(self, pllink->controller, NULL);
|
||||
local_table = lnk_vrf ? lnk_vrf->table : RT_TABLE_LOCAL;
|
||||
|
||||
c_list_for_each (iter, &head_entry->lst_entries_head) {
|
||||
|
|
@ -6049,7 +6050,7 @@ nm_platform_vlan_qos_mapping_to_string(const char *name,
|
|||
const char *
|
||||
nm_platform_link_to_string(const NMPlatformLink *link, char *buf, gsize len)
|
||||
{
|
||||
char master[20];
|
||||
char controller[20];
|
||||
char parent[20];
|
||||
char str_flags[1 + NM_PLATFORM_LINK_FLAGS2STR_MAX_LEN + 1];
|
||||
char str_highlighted_flags[50];
|
||||
|
|
@ -6084,10 +6085,10 @@ nm_platform_link_to_string(const NMPlatformLink *link, char *buf, gsize len)
|
|||
} else
|
||||
str_flags[0] = '\0';
|
||||
|
||||
if (link->master)
|
||||
g_snprintf(master, sizeof(master), " master %d", link->master);
|
||||
if (link->controller)
|
||||
g_snprintf(controller, sizeof(controller), " controller %d", link->controller);
|
||||
else
|
||||
master[0] = 0;
|
||||
controller[0] = 0;
|
||||
|
||||
if (link->parent > 0)
|
||||
g_snprintf(parent, sizeof(parent), "@%d", link->parent);
|
||||
|
|
@ -6115,7 +6116,7 @@ nm_platform_link_to_string(const NMPlatformLink *link, char *buf, gsize len)
|
|||
"%s" /* parent */
|
||||
" <%s%s>" /* flags */
|
||||
" mtu %d"
|
||||
"%s" /* master */
|
||||
"%s" /* controller */
|
||||
" arp %u" /* arptype */
|
||||
" %s" /* link->type */
|
||||
"%s%s" /* kind */
|
||||
|
|
@ -6139,7 +6140,7 @@ nm_platform_link_to_string(const NMPlatformLink *link, char *buf, gsize len)
|
|||
str_highlighted_flags,
|
||||
str_flags,
|
||||
link->mtu,
|
||||
master,
|
||||
controller,
|
||||
link->arptype,
|
||||
str_link_type ?: "???",
|
||||
link->kind ? (g_strcmp0(str_link_type, link->kind) ? "/" : "*") : "?",
|
||||
|
|
@ -8032,7 +8033,7 @@ nm_platform_link_hash_update(const NMPlatformLink *obj, NMHashState *h)
|
|||
{
|
||||
nm_hash_update_vals(h,
|
||||
obj->ifindex,
|
||||
obj->master,
|
||||
obj->controller,
|
||||
obj->parent,
|
||||
obj->n_ifi_flags,
|
||||
obj->mtu,
|
||||
|
|
@ -8095,7 +8096,7 @@ nm_platform_link_cmp(const NMPlatformLink *a, const NMPlatformLink *b)
|
|||
NM_CMP_FIELD(a, b, ifindex);
|
||||
NM_CMP_FIELD(a, b, type);
|
||||
NM_CMP_FIELD_STR(a, b, name);
|
||||
NM_CMP_FIELD(a, b, master);
|
||||
NM_CMP_FIELD(a, b, controller);
|
||||
NM_CMP_FIELD(a, b, parent);
|
||||
NM_CMP_FIELD(a, b, n_ifi_flags);
|
||||
NM_CMP_FIELD_UNSAFE(a, b, connected);
|
||||
|
|
|
|||
|
|
@ -198,7 +198,7 @@ struct _NMPlatformLink {
|
|||
/* NMPlatform initializes this field with a static string. */
|
||||
const char *driver;
|
||||
|
||||
int master;
|
||||
int controller;
|
||||
|
||||
/* rtnl_link_get_link(), IFLA_LINK.
|
||||
* If IFLA_LINK_NETNSID indicates that the parent is in another namespace,
|
||||
|
|
@ -244,7 +244,7 @@ struct _NMPlatformLink {
|
|||
/* IFLA_INFO_SLAVE_KIND */
|
||||
NMPortKind port_kind;
|
||||
|
||||
/* @connected is mostly identical to (@n_ifi_flags & IFF_UP). Except for bridge/bond masters,
|
||||
/* @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. */
|
||||
bool connected : 1;
|
||||
|
||||
|
|
@ -1187,7 +1187,7 @@ typedef struct {
|
|||
gboolean (*link_set_sriov_vfs)(NMPlatform *self, int ifindex, const NMPlatformVF *const *vfs);
|
||||
gboolean (*link_set_bridge_vlans)(NMPlatform *self,
|
||||
int ifindex,
|
||||
gboolean on_master,
|
||||
gboolean on_controller,
|
||||
const NMPlatformBridgeVlan *const *vlans);
|
||||
gboolean (*link_set_bridge_info)(NMPlatform *self,
|
||||
int ifindex,
|
||||
|
|
@ -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 master, int slave);
|
||||
gboolean (*link_release)(NMPlatform *self, int master, int slave);
|
||||
gboolean (*link_enslave)(NMPlatform *self, int controller, int slave);
|
||||
gboolean (*link_release)(NMPlatform *self, int controller, int slave);
|
||||
|
||||
gboolean (*link_can_assume)(NMPlatform *self, int ifindex);
|
||||
|
||||
|
|
@ -1973,7 +1973,7 @@ 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_master(NMPlatform *self, int slave);
|
||||
int nm_platform_link_get_controller(NMPlatform *self, int slave);
|
||||
|
||||
gboolean nm_platform_link_can_assume(NMPlatform *self, int ifindex);
|
||||
|
||||
|
|
@ -2051,7 +2051,7 @@ gboolean
|
|||
nm_platform_link_set_sriov_vfs(NMPlatform *self, int ifindex, const NMPlatformVF *const *vfs);
|
||||
gboolean nm_platform_link_set_bridge_vlans(NMPlatform *self,
|
||||
int ifindex,
|
||||
gboolean on_master,
|
||||
gboolean on_controller,
|
||||
const NMPlatformBridgeVlan *const *vlans);
|
||||
gboolean nm_platform_link_set_bridge_info(NMPlatform *self,
|
||||
int ifindex,
|
||||
|
|
@ -2070,14 +2070,14 @@ 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 master, int slave);
|
||||
gboolean nm_platform_link_release(NMPlatform *self, int master, int slave);
|
||||
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_sysctl_master_set_option(NMPlatform *self,
|
||||
int ifindex,
|
||||
const char *option,
|
||||
const char *value);
|
||||
char *nm_platform_sysctl_master_get_option(NMPlatform *self, int ifindex, const char *option);
|
||||
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,
|
||||
|
|
@ -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) 162)
|
||||
#define NM_PLATFORM_LINK_FLAGS2STR_MAX_LEN ((gsize) 166)
|
||||
|
||||
gboolean nm_platform_ethtool_set_wake_on_lan(NMPlatform *self,
|
||||
int ifindex,
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ NM_UTILS_FLAGS2STR_DEFINE(nm_platform_link_flags2str,
|
|||
NM_UTILS_FLAGS2STR(IFF_NOARP, "noarp"),
|
||||
NM_UTILS_FLAGS2STR(IFF_ALLMULTI, "allmulti"),
|
||||
NM_UTILS_FLAGS2STR(IFF_PROMISC, "promisc"),
|
||||
NM_UTILS_FLAGS2STR(IFF_MASTER, "master"),
|
||||
NM_UTILS_FLAGS2STR(IFF_MASTER, "controller"),
|
||||
NM_UTILS_FLAGS2STR(IFF_SLAVE, "slave"),
|
||||
NM_UTILS_FLAGS2STR(IFF_DEBUG, "debug"),
|
||||
NM_UTILS_FLAGS2STR(IFF_DYNAMIC, "dynamic"),
|
||||
|
|
|
|||
|
|
@ -701,9 +701,9 @@ _nmp_object_fixup_link_udev_fields(NMPObject **obj_new, NMPObject *obj_orig, gbo
|
|||
}
|
||||
|
||||
static void
|
||||
_nmp_object_fixup_link_master_connected(NMPObject **obj_new,
|
||||
NMPObject *obj_orig,
|
||||
const NMPCache *cache)
|
||||
_nmp_object_fixup_link_controller_connected(NMPObject **obj_new,
|
||||
NMPObject *obj_orig,
|
||||
const NMPCache *cache)
|
||||
{
|
||||
NMPObject *obj;
|
||||
|
||||
|
|
@ -2035,18 +2035,18 @@ nmp_cache_use_udev_get(const NMPCache *cache)
|
|||
/*****************************************************************************/
|
||||
|
||||
gboolean
|
||||
nmp_cache_link_connected_for_slave(int ifindex_master, const NMPObject *slave)
|
||||
nmp_cache_link_connected_for_slave(int ifindex_controller, const NMPObject *slave)
|
||||
{
|
||||
nm_assert(NMP_OBJECT_GET_TYPE(slave) == NMP_OBJECT_TYPE_LINK);
|
||||
|
||||
return ifindex_master > 0 && slave->link.master == ifindex_master && slave->link.connected
|
||||
&& nmp_object_is_visible(slave);
|
||||
return ifindex_controller > 0 && slave->link.controller == ifindex_controller
|
||||
&& slave->link.connected && nmp_object_is_visible(slave);
|
||||
}
|
||||
|
||||
/**
|
||||
* nmp_cache_link_connected_needs_toggle:
|
||||
* @cache: the platform cache
|
||||
* @master: the link object, that is checked whether its connected property
|
||||
* @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
|
||||
* as if it was inside @cache. If given, it shaddows a link in the cache
|
||||
|
|
@ -2054,39 +2054,39 @@ nmp_cache_link_connected_for_slave(int ifindex_master, const NMPObject *slave)
|
|||
* @ignore_slave: (nullable): if set, the check will pretend that @ignore_slave
|
||||
* is not in the cache.
|
||||
*
|
||||
* NMPlatformLink has two connected flags: (master->link.flags&IFF_LOWER_UP) (as reported
|
||||
* from netlink) and master->link.connected. For bond and bridge master, kernel reports
|
||||
* 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 masters without slaves as down.
|
||||
* a combined @connected flag that shows controllers without slaves as down.
|
||||
*
|
||||
* Check if the connected flag of @master should be toggled according to the content
|
||||
* Check if the connected flag of @controller should be toggled according to the content
|
||||
* of @cache (including @potential_slave).
|
||||
*
|
||||
* Returns: %TRUE, if @master->link.connected should be flipped/toggled.
|
||||
* Returns: %TRUE, if @controller->link.connected should be flipped/toggled.
|
||||
**/
|
||||
gboolean
|
||||
nmp_cache_link_connected_needs_toggle(const NMPCache *cache,
|
||||
const NMPObject *master,
|
||||
const NMPObject *controller,
|
||||
const NMPObject *potential_slave,
|
||||
const NMPObject *ignore_slave)
|
||||
{
|
||||
gboolean is_lower_up = FALSE;
|
||||
|
||||
if (!master || NMP_OBJECT_GET_TYPE(master) != NMP_OBJECT_TYPE_LINK || master->link.ifindex <= 0
|
||||
|| !nmp_object_is_visible(master)
|
||||
|| !NM_IN_SET(master->link.type, NM_LINK_TYPE_BRIDGE, NM_LINK_TYPE_BOND))
|
||||
if (!controller || NMP_OBJECT_GET_TYPE(controller) != NMP_OBJECT_TYPE_LINK
|
||||
|| controller->link.ifindex <= 0 || !nmp_object_is_visible(controller)
|
||||
|| !NM_IN_SET(controller->link.type, NM_LINK_TYPE_BRIDGE, NM_LINK_TYPE_BOND))
|
||||
return FALSE;
|
||||
|
||||
/* if native IFF_LOWER_UP is down, link.connected must also be down
|
||||
* regardless of the slaves. */
|
||||
if (!NM_FLAGS_HAS(master->link.n_ifi_flags, IFF_LOWER_UP))
|
||||
return !!master->link.connected;
|
||||
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_slave
|
||||
&& nmp_cache_link_connected_for_slave(master->link.ifindex, potential_slave))
|
||||
&& nmp_cache_link_connected_for_slave(controller->link.ifindex, potential_slave))
|
||||
is_lower_up = TRUE;
|
||||
else {
|
||||
NMPLookup lookup;
|
||||
|
|
@ -2101,19 +2101,19 @@ nmp_cache_link_connected_needs_toggle(const NMPCache *cache,
|
|||
|
||||
if ((!potential_slave || potential_slave->link.ifindex != link->ifindex)
|
||||
&& ignore_slave != obj
|
||||
&& nmp_cache_link_connected_for_slave(master->link.ifindex, obj)) {
|
||||
&& nmp_cache_link_connected_for_slave(controller->link.ifindex, obj)) {
|
||||
is_lower_up = TRUE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return !!master->link.connected != is_lower_up;
|
||||
return !!controller->link.connected != is_lower_up;
|
||||
}
|
||||
|
||||
/**
|
||||
* nmp_cache_link_connected_needs_toggle_by_ifindex:
|
||||
* @cache:
|
||||
* @master_ifindex: the ifindex of a potential master that should be checked
|
||||
* @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
|
||||
|
|
@ -2122,25 +2122,25 @@ nmp_cache_link_connected_needs_toggle(const NMPCache *cache,
|
|||
*
|
||||
* 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
|
||||
* of a master, check if the cache contains such a master link that needs
|
||||
* of a controller, check if the cache contains such a controller link that needs
|
||||
* toggling of the connected flag.
|
||||
*
|
||||
* Returns: NULL if there is no master link with ifindex @master_ifindex that should be toggled.
|
||||
* Returns: NULL if there is no controller link with ifindex @controller_ifindex that should be toggled.
|
||||
* Otherwise, return the link object from inside the cache with the given ifindex.
|
||||
* The connected flag of that master should be toggled.
|
||||
* The connected flag of that controller should be toggled.
|
||||
*/
|
||||
const NMPObject *
|
||||
nmp_cache_link_connected_needs_toggle_by_ifindex(const NMPCache *cache,
|
||||
int master_ifindex,
|
||||
int controller_ifindex,
|
||||
const NMPObject *potential_slave,
|
||||
const NMPObject *ignore_slave)
|
||||
{
|
||||
const NMPObject *master;
|
||||
const NMPObject *controller;
|
||||
|
||||
if (master_ifindex > 0) {
|
||||
master = nmp_cache_lookup_link(cache, master_ifindex);
|
||||
if (nmp_cache_link_connected_needs_toggle(cache, master, potential_slave, ignore_slave))
|
||||
return master;
|
||||
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))
|
||||
return controller;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
|
@ -2804,7 +2804,7 @@ nmp_cache_remove_netlink(NMPCache *cache,
|
|||
obj_new = nmp_object_clone(obj_old, FALSE);
|
||||
obj_new->_link.netlink.is_in_netlink = FALSE;
|
||||
|
||||
_nmp_object_fixup_link_master_connected(&obj_new, NULL, cache);
|
||||
_nmp_object_fixup_link_controller_connected(&obj_new, NULL, cache);
|
||||
_nmp_object_fixup_link_udev_fields(&obj_new, NULL, cache->use_udev);
|
||||
|
||||
_idxcache_update(cache, entry_old, obj_new, FALSE, &entry_new);
|
||||
|
|
@ -2878,7 +2878,7 @@ nmp_cache_update_netlink(NMPCache *cache,
|
|||
}
|
||||
|
||||
if (NMP_OBJECT_GET_TYPE(obj_hand_over) == NMP_OBJECT_TYPE_LINK) {
|
||||
_nmp_object_fixup_link_master_connected(&obj_hand_over, NULL, cache);
|
||||
_nmp_object_fixup_link_controller_connected(&obj_hand_over, NULL, cache);
|
||||
_nmp_object_fixup_link_udev_fields(&obj_hand_over, NULL, cache->use_udev);
|
||||
}
|
||||
|
||||
|
|
@ -2914,7 +2914,7 @@ nmp_cache_update_netlink(NMPCache *cache,
|
|||
is_alive = TRUE;
|
||||
|
||||
if (is_alive) {
|
||||
_nmp_object_fixup_link_master_connected(&obj_hand_over, NULL, cache);
|
||||
_nmp_object_fixup_link_controller_connected(&obj_hand_over, NULL, cache);
|
||||
|
||||
/* Merge the netlink parts with what we have from udev. */
|
||||
udev_device_unref(obj_hand_over->_link.udev.device);
|
||||
|
|
@ -3193,10 +3193,10 @@ nmp_cache_update_link_udev(NMPCache *cache,
|
|||
}
|
||||
|
||||
NMPCacheOpsType
|
||||
nmp_cache_update_link_master_connected(NMPCache *cache,
|
||||
int ifindex,
|
||||
const NMPObject **out_obj_old,
|
||||
const NMPObject **out_obj_new)
|
||||
nmp_cache_update_link_controller_connected(NMPCache *cache,
|
||||
int ifindex,
|
||||
const NMPObject **out_obj_old,
|
||||
const NMPObject **out_obj_new)
|
||||
{
|
||||
const NMDedupMultiEntry *entry_old;
|
||||
const NMDedupMultiEntry *entry_new = NULL;
|
||||
|
|
|
|||
|
|
@ -952,13 +952,13 @@ 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_master, const NMPObject *slave);
|
||||
gboolean nmp_cache_link_connected_for_slave(int ifindex_controller, const NMPObject *slave);
|
||||
gboolean nmp_cache_link_connected_needs_toggle(const NMPCache *cache,
|
||||
const NMPObject *master,
|
||||
const NMPObject *controller,
|
||||
const NMPObject *potential_slave,
|
||||
const NMPObject *ignore_slave);
|
||||
const NMPObject *nmp_cache_link_connected_needs_toggle_by_ifindex(const NMPCache *cache,
|
||||
int master_ifindex,
|
||||
const NMPObject *nmp_cache_link_connected_needs_toggle_by_ifindex(const NMPCache *cache,
|
||||
int controller_ifindex,
|
||||
const NMPObject *potential_slave,
|
||||
const NMPObject *ignore_slave);
|
||||
|
||||
|
|
@ -994,10 +994,10 @@ NMPCacheOpsType nmp_cache_update_link_udev(NMPCache *cache,
|
|||
struct udev_device *udevice,
|
||||
const NMPObject **out_obj_old,
|
||||
const NMPObject **out_obj_new);
|
||||
NMPCacheOpsType nmp_cache_update_link_master_connected(NMPCache *cache,
|
||||
int ifindex,
|
||||
const NMPObject **out_obj_old,
|
||||
const NMPObject **out_obj_new);
|
||||
NMPCacheOpsType nmp_cache_update_link_controller_connected(NMPCache *cache,
|
||||
int ifindex,
|
||||
const NMPObject **out_obj_old,
|
||||
const NMPObject **out_obj_new);
|
||||
|
||||
static inline const NMDedupMultiEntry *
|
||||
nmp_cache_reresolve_main_entry(NMPCache *cache,
|
||||
|
|
|
|||
|
|
@ -575,14 +575,14 @@ nmc_activation_get_effective_state(NMActiveConnection *active,
|
|||
}
|
||||
break;
|
||||
case NM_ACTIVE_CONNECTION_STATE_ACTIVATING:
|
||||
/* activating master connection does not automatically activate any slaves, so their
|
||||
/* activating controller connection does not automatically activate any slaves, 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 = "master waiting for slaves";
|
||||
*reason = "controller waiting for slaves";
|
||||
return NM_ACTIVE_CONNECTION_STATE_ACTIVATED;
|
||||
}
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -2763,7 +2763,7 @@ _multilist_remove_by_value_fcn_connection_permissions(NMSetting *setting, const
|
|||
}
|
||||
|
||||
static const char *const *
|
||||
_complete_fcn_connection_master(ARGS_COMPLETE_FCN)
|
||||
_complete_fcn_connection_controller(ARGS_COMPLETE_FCN)
|
||||
{
|
||||
NMRemoteConnection *const *connections = NULL;
|
||||
guint len = 0;
|
||||
|
|
@ -5584,7 +5584,7 @@ static const NMMetaPropertyInfo *const property_infos_CONNECTION[] = {
|
|||
.property_type = DEFINE_PROPERTY_TYPE (
|
||||
.get_fcn = _get_fcn_gobject,
|
||||
.set_fcn = _set_fcn_gobject_string,
|
||||
.complete_fcn = _complete_fcn_connection_master,
|
||||
.complete_fcn = _complete_fcn_connection_controller,
|
||||
.doc_format = NM_META_PROPERTY_TYPE_FORMAT_STRING,
|
||||
),
|
||||
),
|
||||
|
|
@ -5596,7 +5596,7 @@ static const NMMetaPropertyInfo *const property_infos_CONNECTION[] = {
|
|||
.property_type = DEFINE_PROPERTY_TYPE (
|
||||
.get_fcn = _get_fcn_gobject,
|
||||
.set_fcn = _set_fcn_gobject_string,
|
||||
.complete_fcn = _complete_fcn_connection_master,
|
||||
.complete_fcn = _complete_fcn_connection_controller,
|
||||
.doc_format = NM_META_PROPERTY_TYPE_FORMAT_STRING,
|
||||
),
|
||||
),
|
||||
|
|
|
|||
|
|
@ -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 master 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 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_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).")
|
||||
|
|
@ -14,7 +14,7 @@
|
|||
#define DESCRIBE_DOC_NM_SETTING_CONNECTION_INTERFACE_NAME N_("The name of the network interface this connection is bound to. If not set, then the connection can be attached to any interface of the appropriate type (subject to restrictions imposed by other settings). For software devices this specifies the name of the created device. For connection types where interface names cannot easily be made persistent (e.g. mobile broadband or USB Ethernet), this property should not be used. Setting this property restricts the interfaces a connection can be used with, and if interface names change or are reordered the connection may be applied to the wrong interface.")
|
||||
#define DESCRIBE_DOC_NM_SETTING_CONNECTION_LLDP N_("Whether LLDP is enabled for the connection.")
|
||||
#define DESCRIBE_DOC_NM_SETTING_CONNECTION_LLMNR N_("Whether Link-Local Multicast Name Resolution (LLMNR) is enabled for the connection. LLMNR is a protocol based on the Domain Name System (DNS) packet format that allows both IPv4 and IPv6 hosts to perform name resolution for hosts on the same local link. The permitted values are: \"yes\" (2) register hostname and resolving for the connection, \"no\" (0) disable LLMNR for the interface, \"resolve\" (1) do not register hostname but allow resolving of LLMNR host names If unspecified, \"default\" ultimately depends on the DNS plugin (which for systemd-resolved currently means \"yes\"). This feature requires a plugin which supports LLMNR. Otherwise, the setting has no effect. One such plugin is dns-systemd-resolved.")
|
||||
#define DESCRIBE_DOC_NM_SETTING_CONNECTION_MASTER N_("Interface name of the master device or UUID of the master connection. Deprecated 1.46. Use \"controller\" instead, this is just an alias.")
|
||||
#define DESCRIBE_DOC_NM_SETTING_CONNECTION_MASTER N_("Interface name of the controller device or UUID of the controller connection. Deprecated 1.46. Use \"controller\" instead, this is just an alias.")
|
||||
#define DESCRIBE_DOC_NM_SETTING_CONNECTION_MDNS N_("Whether mDNS is enabled for the connection. The permitted values are: \"yes\" (2) register hostname and resolving for the connection, \"no\" (0) disable mDNS for the interface, \"resolve\" (1) do not register hostname but allow resolving of mDNS host names and \"default\" (-1) to allow lookup of a global default in NetworkManager.conf. If unspecified, \"default\" ultimately depends on the DNS plugin. This feature requires a plugin which supports mDNS. Otherwise, the setting has no effect. Currently the only supported DNS plugin is systemd-resolved. For systemd-resolved, the default is configurable via MulticastDNS= setting in resolved.conf.")
|
||||
#define DESCRIBE_DOC_NM_SETTING_CONNECTION_METERED N_("Whether the connection is metered. When updating this property on a currently activated connection, the change takes effect immediately.")
|
||||
#define DESCRIBE_DOC_NM_SETTING_CONNECTION_MPTCP_FLAGS N_("Whether to configure MPTCP endpoints and the address flags. If MPTCP is enabled in NetworkManager, it will configure the addresses of the interface as MPTCP endpoints. Note that IPv4 loopback addresses (127.0.0.0/8), IPv4 link local addresses (169.254.0.0/16), the IPv6 loopback address (::1), IPv6 link local addresses (fe80::/10), IPv6 unique local addresses (ULA, fc00::/7) and IPv6 privacy extension addresses (rfc3041, ipv6.ip6-privacy) will be excluded from being configured as endpoints. If \"disabled\" (0x1), MPTCP handling for the interface is disabled and no endpoints are registered. The \"enabled\" (0x2) flag means that MPTCP handling is enabled. This flag can also be implied from the presence of other flags. Even when enabled, MPTCP handling will by default still be disabled unless \"/proc/sys/net/mptcp/enabled\" sysctl is on. NetworkManager does not change the sysctl and this is up to the administrator or distribution. To configure endpoints even if the sysctl is disabled, \"also-without-sysctl\" (0x4) flag can be used. In that case, NetworkManager doesn't look at the sysctl and configures endpoints regardless. Even when enabled, NetworkManager will only configure MPTCP endpoints for a certain address family, if there is a unicast default route (0.0.0.0/0 or ::/0) in the main routing table. The flag \"also-without-default-route\" (0x8) can override that. When MPTCP handling is enabled then endpoints are configured with the specified address flags \"signal\" (0x10), \"subflow\" (0x20), \"backup\" (0x40), \"fullmesh\" (0x80). See ip-mptcp(8) manual for additional information about the flags. If the flags are zero (0x0), the global connection default from NetworkManager.conf is honored. If still unspecified, the fallback is \"enabled,subflow\". Note that this means that MPTCP is by default done depending on the \"/proc/sys/net/mptcp/enabled\" sysctl. NetworkManager does not change the MPTCP limits nor enable MPTCP via \"/proc/sys/net/mptcp/enabled\". That is a host configuration which the admin can change via sysctl and ip-mptcp. Strict reverse path filtering (rp_filter) breaks many MPTCP use cases, so when MPTCP handling for IPv4 addresses on the interface is enabled, NetworkManager would loosen the strict reverse path filtering (1) to the loose setting (2).")
|
||||
|
|
@ -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 master 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 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_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).")
|
||||
|
|
@ -356,7 +356,7 @@
|
|||
#define DESCRIBE_DOC_NM_SETTING_TUN_VNET_HDR N_("If TRUE the IFF_VNET_HDR the tunnel packets will include a virtio network header.")
|
||||
#define DESCRIBE_DOC_NM_SETTING_USER_DATA N_("A dictionary of key/value pairs with user data. This data is ignored by NetworkManager and can be used at the users discretion. The keys only support a strict ascii format, but the values can be arbitrary UTF8 strings up to a certain length.")
|
||||
#define DESCRIBE_DOC_NM_SETTING_VLAN_EGRESS_PRIORITY_MAP N_("For outgoing packets, a list of mappings from Linux SKB priorities to 802.1p priorities. The mapping is given in the format \"from:to\" where both \"from\" and \"to\" are unsigned integers, ie \"7:3\".")
|
||||
#define DESCRIBE_DOC_NM_SETTING_VLAN_FLAGS N_("One or more flags which control the behavior and features of the VLAN interface. Flags include \"reorder-headers\" (0x1) (reordering of output packet headers), \"gvrp\" (0x2) (use of the GVRP protocol), and \"loose-binding\" (0x4) (loose binding of the interface to its master device's operating state). \"mvrp\" (0x8) (use of the MVRP protocol). The default value of this property is NM_VLAN_FLAG_REORDER_HEADERS, but it used to be 0. To preserve backward compatibility, the default-value in the D-Bus API continues to be 0 and a missing property on D-Bus is still considered as 0.")
|
||||
#define DESCRIBE_DOC_NM_SETTING_VLAN_FLAGS N_("One or more flags which control the behavior and features of the VLAN interface. Flags include \"reorder-headers\" (0x1) (reordering of output packet headers), \"gvrp\" (0x2) (use of the GVRP protocol), and \"loose-binding\" (0x4) (loose binding of the interface to its controller device's operating state). \"mvrp\" (0x8) (use of the MVRP protocol). The default value of this property is NM_VLAN_FLAG_REORDER_HEADERS, but it used to be 0. To preserve backward compatibility, the default-value in the D-Bus API continues to be 0 and a missing property on D-Bus is still considered as 0.")
|
||||
#define DESCRIBE_DOC_NM_SETTING_VLAN_ID N_("The VLAN identifier that the interface created by this connection should be assigned. The valid range is from 0 to 4094, without the reserved id 4095.")
|
||||
#define DESCRIBE_DOC_NM_SETTING_VLAN_INGRESS_PRIORITY_MAP N_("For incoming packets, a list of mappings from 802.1p priorities to Linux SKB priorities. The mapping is given in the format \"from:to\" where both \"from\" and \"to\" are unsigned integers, ie \"7:3\".")
|
||||
#define DESCRIBE_DOC_NM_SETTING_VLAN_PARENT N_("If given, specifies the parent interface name or parent connection UUID from which this VLAN interface should be created. If this property is not specified, the connection must contain an \"802-3-ethernet\" setting with a \"mac-address\" property.")
|
||||
|
|
|
|||
|
|
@ -223,28 +223,28 @@ void link_del_ip4(Link *link, const struct in_addr *addr, unsigned int prefix) {
|
|||
}
|
||||
|
||||
/**
|
||||
* link_set_master() - change the bridge master of an interface
|
||||
* @link: link to operate on
|
||||
* @if_master: bridge to set as master
|
||||
* link_set_controller() - change the bridge controller of an interface
|
||||
* @link: link to operate on
|
||||
* @if_controller: bridge to set as controller
|
||||
*
|
||||
* This sets @if_master as the new master bridge of @link. The specified bridge
|
||||
* This sets @if_controller as the new controller bridge of @link. The specified bridge
|
||||
* must be in the same network namespace as @link.
|
||||
*/
|
||||
void link_set_master(Link *link, int if_master) {
|
||||
void link_set_controller(Link *link, int if_controller) {
|
||||
int oldns;
|
||||
|
||||
netns_get(&oldns);
|
||||
{
|
||||
char *p, ifname_master[IF_NAMESIZE + 1] = {}, ifname[IF_NAMESIZE + 1] = {};
|
||||
char *p, ifname_controller[IF_NAMESIZE + 1] = {}, ifname[IF_NAMESIZE + 1] = {};
|
||||
int r;
|
||||
|
||||
netns_set(link->netns);
|
||||
|
||||
p = if_indextoname(link->ifindex, ifname);
|
||||
c_assert(p);
|
||||
p = if_indextoname(if_master, ifname_master);
|
||||
p = if_indextoname(if_controller, ifname_controller);
|
||||
c_assert(p);
|
||||
r = asprintf(&p, "ip link set %s master %s", ifname, ifname_master);
|
||||
r = asprintf(&p, "ip link set %s master %s", ifname, ifname_controller);
|
||||
c_assert(r > 0);
|
||||
r = system(p);
|
||||
c_assert(r == 0);
|
||||
|
|
|
|||
|
|
@ -866,25 +866,28 @@ reader_parse_ip(Reader *reader, const char *sysfs_dir, char *argument)
|
|||
}
|
||||
|
||||
static void
|
||||
reader_parse_master(Reader *reader, char *argument, const char *type_name, const char *default_name)
|
||||
reader_parse_controller(Reader *reader,
|
||||
char *argument,
|
||||
const char *type_name,
|
||||
const char *default_name)
|
||||
{
|
||||
NMConnection *connection;
|
||||
NMSettingConnection *s_con;
|
||||
gs_free char *master_to_free = NULL;
|
||||
const char *master;
|
||||
gs_free char *controller_to_free = NULL;
|
||||
const char *controller;
|
||||
char *slaves;
|
||||
const char *slave;
|
||||
char *opts;
|
||||
const char *mtu = NULL;
|
||||
|
||||
master = get_word(&argument, ':');
|
||||
if (!master)
|
||||
master = master_to_free = g_strdup_printf("%s0", default_name ?: type_name);
|
||||
controller = get_word(&argument, ':');
|
||||
if (!controller)
|
||||
controller = controller_to_free = g_strdup_printf("%s0", default_name ?: type_name);
|
||||
slaves = get_word(&argument, ':');
|
||||
|
||||
connection = reader_get_connection(reader, master, type_name, TRUE);
|
||||
connection = reader_get_connection(reader, controller, type_name, TRUE);
|
||||
s_con = nm_connection_get_setting_connection(connection);
|
||||
master = nm_setting_connection_get_uuid(s_con);
|
||||
controller = nm_setting_connection_get_uuid(s_con);
|
||||
|
||||
if (nm_streq(type_name, NM_SETTING_BRIDGE_SETTING_NAME)) {
|
||||
NMSettingBridge *s_bridge = nm_connection_get_setting_bridge(connection);
|
||||
|
|
@ -931,7 +934,7 @@ reader_parse_master(Reader *reader, char *argument, const char *type_name, const
|
|||
NM_SETTING_CONNECTION_PORT_TYPE,
|
||||
type_name,
|
||||
NM_SETTING_CONNECTION_CONTROLLER,
|
||||
master,
|
||||
controller,
|
||||
NULL);
|
||||
} while (slaves && *slaves != '\0');
|
||||
|
||||
|
|
@ -1468,11 +1471,11 @@ nmi_cmdline_reader_parse(const char *etc_connections_dir,
|
|||
routes = g_ptr_array_new_with_free_func(g_free);
|
||||
g_ptr_array_add(routes, g_strdup(argument));
|
||||
} else if (nm_streq(tag, "bridge"))
|
||||
reader_parse_master(reader, argument, NM_SETTING_BRIDGE_SETTING_NAME, "br");
|
||||
reader_parse_controller(reader, argument, NM_SETTING_BRIDGE_SETTING_NAME, "br");
|
||||
else if (nm_streq(tag, "bond"))
|
||||
reader_parse_master(reader, argument, NM_SETTING_BOND_SETTING_NAME, NULL);
|
||||
reader_parse_controller(reader, argument, NM_SETTING_BOND_SETTING_NAME, NULL);
|
||||
else if (nm_streq(tag, "team"))
|
||||
reader_parse_master(reader, argument, NM_SETTING_TEAM_SETTING_NAME, NULL);
|
||||
reader_parse_controller(reader, argument, NM_SETTING_TEAM_SETTING_NAME, NULL);
|
||||
else if (nm_streq(tag, "vlan"))
|
||||
reader_parse_vlan(reader, argument);
|
||||
else if (nm_streq(tag, "ib.pkey"))
|
||||
|
|
|
|||
|
|
@ -975,7 +975,7 @@ test_bond(void)
|
|||
NMSettingBond *s_bond;
|
||||
NMSettingWired *s_wired;
|
||||
NMIPRoute *ip_route;
|
||||
const char *master_uuid;
|
||||
const char *controller_uuid;
|
||||
|
||||
connections = _parse_cons(ARGV);
|
||||
g_assert_cmpint(g_hash_table_size(connections), ==, 3);
|
||||
|
|
@ -986,8 +986,8 @@ test_bond(void)
|
|||
==,
|
||||
NM_SETTING_BOND_SETTING_NAME);
|
||||
g_assert_cmpstr(nm_connection_get_id(connection), ==, "bong0");
|
||||
master_uuid = nm_connection_get_uuid(connection);
|
||||
g_assert(master_uuid);
|
||||
controller_uuid = nm_connection_get_uuid(connection);
|
||||
g_assert(controller_uuid);
|
||||
|
||||
s_wired = nm_connection_get_setting_wired(connection);
|
||||
g_assert(s_wired);
|
||||
|
|
@ -1032,7 +1032,7 @@ test_bond(void)
|
|||
NM_SETTING_WIRED_SETTING_NAME);
|
||||
g_assert_cmpstr(nm_setting_connection_get_id(s_con), ==, "eth0");
|
||||
g_assert_cmpstr(nm_setting_connection_get_port_type(s_con), ==, NM_SETTING_BOND_SETTING_NAME);
|
||||
g_assert_cmpstr(nm_setting_connection_get_controller(s_con), ==, master_uuid);
|
||||
g_assert_cmpstr(nm_setting_connection_get_controller(s_con), ==, controller_uuid);
|
||||
g_assert_cmpint(nm_setting_connection_get_multi_connect(s_con),
|
||||
==,
|
||||
NM_CONNECTION_MULTI_CONNECT_SINGLE);
|
||||
|
|
@ -1048,7 +1048,7 @@ test_bond(void)
|
|||
NM_SETTING_WIRED_SETTING_NAME);
|
||||
g_assert_cmpstr(nm_setting_connection_get_id(s_con), ==, "eth1");
|
||||
g_assert_cmpstr(nm_setting_connection_get_port_type(s_con), ==, NM_SETTING_BOND_SETTING_NAME);
|
||||
g_assert_cmpstr(nm_setting_connection_get_controller(s_con), ==, master_uuid);
|
||||
g_assert_cmpstr(nm_setting_connection_get_controller(s_con), ==, controller_uuid);
|
||||
g_assert_cmpint(nm_setting_connection_get_multi_connect(s_con),
|
||||
==,
|
||||
NM_CONNECTION_MULTI_CONNECT_SINGLE);
|
||||
|
|
@ -1069,7 +1069,7 @@ test_bond_ip(void)
|
|||
NMSettingWired *s_wired;
|
||||
NMSettingBond *s_bond;
|
||||
NMIPAddress *ip_addr;
|
||||
const char *master_uuid;
|
||||
const char *controller_uuid;
|
||||
|
||||
connections = _parse_cons(ARGV);
|
||||
g_assert_cmpint(g_hash_table_size(connections), ==, 3);
|
||||
|
|
@ -1080,8 +1080,8 @@ test_bond_ip(void)
|
|||
==,
|
||||
NM_SETTING_BOND_SETTING_NAME);
|
||||
g_assert_cmpstr(nm_connection_get_id(connection), ==, "bond0");
|
||||
master_uuid = nm_connection_get_uuid(connection);
|
||||
g_assert(master_uuid);
|
||||
controller_uuid = nm_connection_get_uuid(connection);
|
||||
g_assert(controller_uuid);
|
||||
|
||||
s_wired = nm_connection_get_setting_wired(connection);
|
||||
g_assert(s_wired);
|
||||
|
|
@ -1130,7 +1130,7 @@ test_bond_ip(void)
|
|||
NM_SETTING_WIRED_SETTING_NAME);
|
||||
g_assert_cmpstr(nm_setting_connection_get_id(s_con), ==, "eth0");
|
||||
g_assert_cmpstr(nm_setting_connection_get_port_type(s_con), ==, NM_SETTING_BOND_SETTING_NAME);
|
||||
g_assert_cmpstr(nm_setting_connection_get_controller(s_con), ==, master_uuid);
|
||||
g_assert_cmpstr(nm_setting_connection_get_controller(s_con), ==, controller_uuid);
|
||||
g_assert_cmpint(nm_setting_connection_get_multi_connect(s_con),
|
||||
==,
|
||||
NM_CONNECTION_MULTI_CONNECT_SINGLE);
|
||||
|
|
@ -1146,7 +1146,7 @@ test_bond_ip(void)
|
|||
NM_SETTING_WIRED_SETTING_NAME);
|
||||
g_assert_cmpstr(nm_setting_connection_get_id(s_con), ==, "eth1");
|
||||
g_assert_cmpstr(nm_setting_connection_get_port_type(s_con), ==, NM_SETTING_BOND_SETTING_NAME);
|
||||
g_assert_cmpstr(nm_setting_connection_get_controller(s_con), ==, master_uuid);
|
||||
g_assert_cmpstr(nm_setting_connection_get_controller(s_con), ==, controller_uuid);
|
||||
g_assert_cmpint(nm_setting_connection_get_multi_connect(s_con),
|
||||
==,
|
||||
NM_CONNECTION_MULTI_CONNECT_SINGLE);
|
||||
|
|
@ -1162,7 +1162,7 @@ test_bond_default(void)
|
|||
NMSettingIPConfig *s_ip4;
|
||||
NMSettingIPConfig *s_ip6;
|
||||
NMSettingBond *s_bond;
|
||||
const char *master_uuid;
|
||||
const char *controller_uuid;
|
||||
|
||||
connections = _parse_cons(ARGV);
|
||||
g_assert_cmpint(g_hash_table_size(connections), ==, 2);
|
||||
|
|
@ -1174,8 +1174,8 @@ test_bond_default(void)
|
|||
==,
|
||||
NM_SETTING_BOND_SETTING_NAME);
|
||||
g_assert_cmpstr(nm_connection_get_id(connection), ==, "bond0");
|
||||
master_uuid = nm_connection_get_uuid(connection);
|
||||
g_assert(master_uuid);
|
||||
controller_uuid = nm_connection_get_uuid(connection);
|
||||
g_assert(controller_uuid);
|
||||
|
||||
s_ip4 = nm_connection_get_setting_ip4_config(connection);
|
||||
g_assert(s_ip4);
|
||||
|
|
@ -1209,7 +1209,7 @@ test_bond_default(void)
|
|||
NM_SETTING_WIRED_SETTING_NAME);
|
||||
g_assert_cmpstr(nm_setting_connection_get_id(s_con), ==, "eth0");
|
||||
g_assert_cmpstr(nm_setting_connection_get_port_type(s_con), ==, NM_SETTING_BOND_SETTING_NAME);
|
||||
g_assert_cmpstr(nm_setting_connection_get_controller(s_con), ==, master_uuid);
|
||||
g_assert_cmpstr(nm_setting_connection_get_controller(s_con), ==, controller_uuid);
|
||||
g_assert_cmpint(nm_setting_connection_get_multi_connect(s_con),
|
||||
==,
|
||||
NM_CONNECTION_MULTI_CONNECT_SINGLE);
|
||||
|
|
@ -1228,7 +1228,7 @@ test_bridge(void)
|
|||
NMSettingIPConfig *s_ip6;
|
||||
NMSettingBridge *s_bridge;
|
||||
NMIPRoute *ip_route;
|
||||
const char *master_uuid;
|
||||
const char *controller_uuid;
|
||||
|
||||
connections = _parse_cons(ARGV);
|
||||
g_assert_cmpint(g_hash_table_size(connections), ==, 3);
|
||||
|
|
@ -1239,8 +1239,8 @@ test_bridge(void)
|
|||
==,
|
||||
NM_SETTING_BRIDGE_SETTING_NAME);
|
||||
g_assert_cmpstr(nm_connection_get_id(connection), ==, "bridge0");
|
||||
master_uuid = nm_connection_get_uuid(connection);
|
||||
g_assert(master_uuid);
|
||||
controller_uuid = nm_connection_get_uuid(connection);
|
||||
g_assert(controller_uuid);
|
||||
|
||||
s_ip4 = nm_connection_get_setting_ip4_config(connection);
|
||||
g_assert(s_ip4);
|
||||
|
|
@ -1285,7 +1285,7 @@ test_bridge(void)
|
|||
NM_SETTING_WIRED_SETTING_NAME);
|
||||
g_assert_cmpstr(nm_setting_connection_get_id(s_con), ==, "eth0");
|
||||
g_assert_cmpstr(nm_setting_connection_get_port_type(s_con), ==, NM_SETTING_BRIDGE_SETTING_NAME);
|
||||
g_assert_cmpstr(nm_setting_connection_get_controller(s_con), ==, master_uuid);
|
||||
g_assert_cmpstr(nm_setting_connection_get_controller(s_con), ==, controller_uuid);
|
||||
g_assert_cmpint(nm_setting_connection_get_multi_connect(s_con),
|
||||
==,
|
||||
NM_CONNECTION_MULTI_CONNECT_SINGLE);
|
||||
|
|
@ -1301,7 +1301,7 @@ test_bridge(void)
|
|||
NM_SETTING_WIRED_SETTING_NAME);
|
||||
g_assert_cmpstr(nm_setting_connection_get_id(s_con), ==, "eth1");
|
||||
g_assert_cmpstr(nm_setting_connection_get_port_type(s_con), ==, NM_SETTING_BRIDGE_SETTING_NAME);
|
||||
g_assert_cmpstr(nm_setting_connection_get_controller(s_con), ==, master_uuid);
|
||||
g_assert_cmpstr(nm_setting_connection_get_controller(s_con), ==, controller_uuid);
|
||||
g_assert_cmpint(nm_setting_connection_get_multi_connect(s_con),
|
||||
==,
|
||||
NM_CONNECTION_MULTI_CONNECT_SINGLE);
|
||||
|
|
@ -1317,7 +1317,7 @@ test_bridge_default(void)
|
|||
NMSettingIPConfig *s_ip4;
|
||||
NMSettingIPConfig *s_ip6;
|
||||
NMSettingBridge *s_bridge;
|
||||
const char *master_uuid;
|
||||
const char *controller_uuid;
|
||||
|
||||
connections = _parse_cons(ARGV);
|
||||
g_assert_cmpint(g_hash_table_size(connections), ==, 2);
|
||||
|
|
@ -1329,8 +1329,8 @@ test_bridge_default(void)
|
|||
==,
|
||||
NM_SETTING_BRIDGE_SETTING_NAME);
|
||||
g_assert_cmpstr(nm_connection_get_id(connection), ==, "br0");
|
||||
master_uuid = nm_connection_get_uuid(connection);
|
||||
g_assert(master_uuid);
|
||||
controller_uuid = nm_connection_get_uuid(connection);
|
||||
g_assert(controller_uuid);
|
||||
|
||||
s_ip4 = nm_connection_get_setting_ip4_config(connection);
|
||||
g_assert(s_ip4);
|
||||
|
|
@ -1362,7 +1362,7 @@ test_bridge_default(void)
|
|||
NM_SETTING_WIRED_SETTING_NAME);
|
||||
g_assert_cmpstr(nm_setting_connection_get_id(s_con), ==, "eth0");
|
||||
g_assert_cmpstr(nm_setting_connection_get_port_type(s_con), ==, NM_SETTING_BRIDGE_SETTING_NAME);
|
||||
g_assert_cmpstr(nm_setting_connection_get_controller(s_con), ==, master_uuid);
|
||||
g_assert_cmpstr(nm_setting_connection_get_controller(s_con), ==, controller_uuid);
|
||||
g_assert_cmpint(nm_setting_connection_get_multi_connect(s_con),
|
||||
==,
|
||||
NM_CONNECTION_MULTI_CONNECT_SINGLE);
|
||||
|
|
@ -1381,7 +1381,7 @@ test_bridge_ip(void)
|
|||
NMSettingIPConfig *s_ip6;
|
||||
NMSettingWired *s_wired;
|
||||
NMSettingBridge *s_bridge;
|
||||
const char *master_uuid;
|
||||
const char *controller_uuid;
|
||||
guint i;
|
||||
|
||||
connections = _parse_cons(ARGV);
|
||||
|
|
@ -1393,8 +1393,8 @@ test_bridge_ip(void)
|
|||
==,
|
||||
NM_SETTING_BRIDGE_SETTING_NAME);
|
||||
g_assert_cmpstr(nm_connection_get_id(connection), ==, "bridge123");
|
||||
master_uuid = nm_connection_get_uuid(connection);
|
||||
g_assert(master_uuid);
|
||||
controller_uuid = nm_connection_get_uuid(connection);
|
||||
g_assert(controller_uuid);
|
||||
|
||||
s_wired = nm_connection_get_setting_wired(connection);
|
||||
g_assert(s_wired);
|
||||
|
|
@ -1430,7 +1430,7 @@ test_bridge_ip(void)
|
|||
g_assert_cmpstr(nm_setting_connection_get_port_type(s_con),
|
||||
==,
|
||||
NM_SETTING_BRIDGE_SETTING_NAME);
|
||||
g_assert_cmpstr(nm_setting_connection_get_controller(s_con), ==, master_uuid);
|
||||
g_assert_cmpstr(nm_setting_connection_get_controller(s_con), ==, controller_uuid);
|
||||
g_assert_cmpint(nm_setting_connection_get_multi_connect(s_con),
|
||||
==,
|
||||
NM_CONNECTION_MULTI_CONNECT_SINGLE);
|
||||
|
|
@ -1447,7 +1447,7 @@ test_team(void)
|
|||
NMSettingIPConfig *s_ip4;
|
||||
NMSettingIPConfig *s_ip6;
|
||||
NMSettingTeam *s_team;
|
||||
const char *master_uuid;
|
||||
const char *controller_uuid;
|
||||
|
||||
connections = _parse_cons(ARGV);
|
||||
g_assert_cmpint(g_hash_table_size(connections), ==, 3);
|
||||
|
|
@ -1458,8 +1458,8 @@ test_team(void)
|
|||
==,
|
||||
NM_SETTING_TEAM_SETTING_NAME);
|
||||
g_assert_cmpstr(nm_connection_get_id(connection), ==, "team0");
|
||||
master_uuid = nm_connection_get_uuid(connection);
|
||||
g_assert(master_uuid);
|
||||
controller_uuid = nm_connection_get_uuid(connection);
|
||||
g_assert(controller_uuid);
|
||||
|
||||
s_ip4 = nm_connection_get_setting_ip4_config(connection);
|
||||
g_assert(s_ip4);
|
||||
|
|
@ -1494,7 +1494,7 @@ test_team(void)
|
|||
NM_SETTING_WIRED_SETTING_NAME);
|
||||
g_assert_cmpstr(nm_setting_connection_get_id(s_con), ==, "eth0");
|
||||
g_assert_cmpstr(nm_setting_connection_get_port_type(s_con), ==, NM_SETTING_TEAM_SETTING_NAME);
|
||||
g_assert_cmpstr(nm_setting_connection_get_controller(s_con), ==, master_uuid);
|
||||
g_assert_cmpstr(nm_setting_connection_get_controller(s_con), ==, controller_uuid);
|
||||
g_assert_cmpint(nm_setting_connection_get_multi_connect(s_con),
|
||||
==,
|
||||
NM_CONNECTION_MULTI_CONNECT_SINGLE);
|
||||
|
|
@ -1510,7 +1510,7 @@ test_team(void)
|
|||
NM_SETTING_WIRED_SETTING_NAME);
|
||||
g_assert_cmpstr(nm_setting_connection_get_id(s_con), ==, "eth1");
|
||||
g_assert_cmpstr(nm_setting_connection_get_port_type(s_con), ==, NM_SETTING_TEAM_SETTING_NAME);
|
||||
g_assert_cmpstr(nm_setting_connection_get_controller(s_con), ==, master_uuid);
|
||||
g_assert_cmpstr(nm_setting_connection_get_controller(s_con), ==, controller_uuid);
|
||||
g_assert_cmpint(nm_setting_connection_get_multi_connect(s_con),
|
||||
==,
|
||||
NM_CONNECTION_MULTI_CONNECT_SINGLE);
|
||||
|
|
|
|||
|
|
@ -1196,130 +1196,131 @@ usage_connection_down(void)
|
|||
static void
|
||||
usage_connection_add(void)
|
||||
{
|
||||
nmc_printerr(_("Usage: nmcli connection add { ARGUMENTS | help }\n"
|
||||
"\n"
|
||||
"ARGUMENTS := COMMON_OPTIONS TYPE_SPECIFIC_OPTIONS SLAVE_OPTIONS IP_OPTIONS [-- "
|
||||
"([+|-]<setting>.<property> <value>)+]\n\n"
|
||||
" COMMON_OPTIONS:\n"
|
||||
" type <type>\n"
|
||||
" [ifname <interface name> | \"*\"]\n"
|
||||
" [con-name <connection name>]\n"
|
||||
" [autoconnect yes|no]\n"
|
||||
" [save yes|no]\n"
|
||||
" [master <master (ifname, or connection UUID or name)>]\n"
|
||||
" [slave-type <master connection type>]\n\n"
|
||||
" TYPE_SPECIFIC_OPTIONS:\n"
|
||||
" ethernet: [mac <MAC address>]\n"
|
||||
" [cloned-mac <cloned MAC address>]\n"
|
||||
" [mtu <MTU>]\n\n"
|
||||
" wifi: ssid <SSID>\n"
|
||||
" [mac <MAC address>]\n"
|
||||
" [cloned-mac <cloned MAC address>]\n"
|
||||
" [mtu <MTU>]\n"
|
||||
" [mode infrastructure|ap|adhoc]\n\n"
|
||||
" wimax: [mac <MAC address>]\n"
|
||||
" [nsp <NSP>]\n\n"
|
||||
" pppoe: username <PPPoE username>\n"
|
||||
" [password <PPPoE password>]\n"
|
||||
" [service <PPPoE service name>]\n"
|
||||
" [mtu <MTU>]\n"
|
||||
" [mac <MAC address>]\n\n"
|
||||
" gsm: apn <APN>\n"
|
||||
" [user <username>]\n"
|
||||
" [password <password>]\n\n"
|
||||
" cdma: [user <username>]\n"
|
||||
" [password <password>]\n\n"
|
||||
" infiniband: [mac <MAC address>]\n"
|
||||
" [mtu <MTU>]\n"
|
||||
" [transport-mode datagram | connected]\n"
|
||||
" [parent <ifname>]\n"
|
||||
" [p-key <IPoIB P_Key>]\n\n"
|
||||
" bluetooth: [addr <bluetooth address>]\n"
|
||||
" [bt-type panu|nap|dun-gsm|dun-cdma]\n\n"
|
||||
" vlan: dev <parent device (connection UUID, ifname, or MAC)>\n"
|
||||
" id <VLAN ID>\n"
|
||||
" [flags <VLAN flags>]\n"
|
||||
" [ingress <ingress priority mapping>]\n"
|
||||
" [egress <egress priority mapping>]\n"
|
||||
" [mtu <MTU>]\n\n"
|
||||
" bond: [mode balance-rr (0) | active-backup (1) | balance-xor (2) | "
|
||||
"broadcast (3) |\n"
|
||||
" 802.3ad (4) | balance-tlb (5) | balance-alb (6)]\n"
|
||||
" [primary <ifname>]\n"
|
||||
" [miimon <num>]\n"
|
||||
" [downdelay <num>]\n"
|
||||
" [updelay <num>]\n"
|
||||
" [arp-interval <num>]\n"
|
||||
" [arp-ip-target <num>]\n"
|
||||
" [lacp-rate slow (0) | fast (1)]\n\n"
|
||||
" bond-slave: master <master (ifname, or connection UUID or name)>\n"
|
||||
" [queue-id <0-65535>]\n\n"
|
||||
" team: [config <file>|<raw JSON data>]\n\n"
|
||||
" team-slave: master <master (ifname, or connection UUID or name)>\n"
|
||||
" [config <file>|<raw JSON data>]\n\n"
|
||||
" bridge: [stp yes|no]\n"
|
||||
" [priority <num>]\n"
|
||||
" [forward-delay <2-30>]\n"
|
||||
" [hello-time <1-10>]\n"
|
||||
" [max-age <6-40>]\n"
|
||||
" [ageing-time <0-1000000>]\n"
|
||||
" [multicast-snooping yes|no]\n"
|
||||
" [mac <MAC address>]\n\n"
|
||||
" bridge-slave: master <master (ifname, or connection UUID or name)>\n"
|
||||
" [priority <0-63>]\n"
|
||||
" [path-cost <1-65535>]\n"
|
||||
" [hairpin yes|no]\n\n"
|
||||
" vpn: vpn-type "
|
||||
"vpnc|openvpn|pptp|openconnect|openswan|libreswan|ssh|l2tp|iodine|...\n"
|
||||
" [user <username>]\n\n"
|
||||
" olpc-mesh: ssid <SSID>\n"
|
||||
" [channel <1-13>]\n"
|
||||
" [dhcp-anycast <MAC address>]\n\n"
|
||||
" adsl: username <username>\n"
|
||||
" protocol pppoa|pppoe|ipoatm\n"
|
||||
" [password <password>]\n"
|
||||
" [encapsulation vcmux|llc]\n\n"
|
||||
" tun: mode tun|tap\n"
|
||||
" [owner <UID>]\n"
|
||||
" [group <GID>]\n"
|
||||
" [pi yes|no]\n"
|
||||
" [vnet-hdr yes|no]\n"
|
||||
" [multi-queue yes|no]\n\n"
|
||||
" ip-tunnel: mode ipip|gre|sit|isatap|vti|ip6ip6|ipip6|ip6gre|vti6\n"
|
||||
" remote <remote endpoint IP>\n"
|
||||
" [local <local endpoint IP>]\n"
|
||||
" [dev <parent device (ifname or connection UUID)>]\n\n"
|
||||
" macsec: dev <parent device (connection UUID, ifname, or MAC)>\n"
|
||||
" mode <psk|eap>\n"
|
||||
" [cak <key> ckn <key>]\n"
|
||||
" [encrypt yes|no]\n"
|
||||
" [port 1-65534]\n\n\n"
|
||||
" macvlan: dev <parent device (connection UUID, ifname, or MAC)>\n"
|
||||
" mode vepa|bridge|private|passthru|source\n"
|
||||
" [tap yes|no]\n\n"
|
||||
" vxlan: id <VXLAN ID>\n"
|
||||
" [remote <IP of multicast group or remote address>]\n"
|
||||
" [local <source IP>]\n"
|
||||
" [dev <parent device (ifname or connection UUID)>]\n"
|
||||
" [source-port-min <0-65535>]\n"
|
||||
" [source-port-max <0-65535>]\n"
|
||||
" [destination-port <0-65535>]\n\n"
|
||||
" wpan: [short-addr <0x0000-0xffff>]\n"
|
||||
" [pan-id <0x0000-0xffff>]\n"
|
||||
" [page <default|0-31>]\n"
|
||||
" [channel <default|0-26>]\n"
|
||||
" [mac <MAC address>]\n\n"
|
||||
" 6lowpan: dev <parent device (connection UUID, ifname, or MAC)>\n"
|
||||
" dummy:\n\n"
|
||||
" SLAVE_OPTIONS:\n"
|
||||
" bridge: [priority <0-63>]\n"
|
||||
" [path-cost <1-65535>]\n"
|
||||
" [hairpin yes|no]\n\n"
|
||||
" team: [config <file>|<raw JSON data>]\n\n"
|
||||
" bond: [queue-id <0-65535>]\n\n"
|
||||
" IP_OPTIONS:\n"
|
||||
" [ip4 <IPv4 address>] [gw4 <IPv4 gateway>]\n"
|
||||
" [ip6 <IPv6 address>] [gw6 <IPv6 gateway>]\n\n"));
|
||||
nmc_printerr(
|
||||
_("Usage: nmcli connection add { ARGUMENTS | help }\n"
|
||||
"\n"
|
||||
"ARGUMENTS := COMMON_OPTIONS TYPE_SPECIFIC_OPTIONS SLAVE_OPTIONS IP_OPTIONS [-- "
|
||||
"([+|-]<setting>.<property> <value>)+]\n\n"
|
||||
" COMMON_OPTIONS:\n"
|
||||
" type <type>\n"
|
||||
" [ifname <interface name> | \"*\"]\n"
|
||||
" [con-name <connection name>]\n"
|
||||
" [autoconnect yes|no]\n"
|
||||
" [save yes|no]\n"
|
||||
" [controller <controller (ifname, or connection UUID or name)>]\n"
|
||||
" [slave-type <controller connection type>]\n\n"
|
||||
" TYPE_SPECIFIC_OPTIONS:\n"
|
||||
" ethernet: [mac <MAC address>]\n"
|
||||
" [cloned-mac <cloned MAC address>]\n"
|
||||
" [mtu <MTU>]\n\n"
|
||||
" wifi: ssid <SSID>\n"
|
||||
" [mac <MAC address>]\n"
|
||||
" [cloned-mac <cloned MAC address>]\n"
|
||||
" [mtu <MTU>]\n"
|
||||
" [mode infrastructure|ap|adhoc]\n\n"
|
||||
" wimax: [mac <MAC address>]\n"
|
||||
" [nsp <NSP>]\n\n"
|
||||
" pppoe: username <PPPoE username>\n"
|
||||
" [password <PPPoE password>]\n"
|
||||
" [service <PPPoE service name>]\n"
|
||||
" [mtu <MTU>]\n"
|
||||
" [mac <MAC address>]\n\n"
|
||||
" gsm: apn <APN>\n"
|
||||
" [user <username>]\n"
|
||||
" [password <password>]\n\n"
|
||||
" cdma: [user <username>]\n"
|
||||
" [password <password>]\n\n"
|
||||
" infiniband: [mac <MAC address>]\n"
|
||||
" [mtu <MTU>]\n"
|
||||
" [transport-mode datagram | connected]\n"
|
||||
" [parent <ifname>]\n"
|
||||
" [p-key <IPoIB P_Key>]\n\n"
|
||||
" bluetooth: [addr <bluetooth address>]\n"
|
||||
" [bt-type panu|nap|dun-gsm|dun-cdma]\n\n"
|
||||
" vlan: dev <parent device (connection UUID, ifname, or MAC)>\n"
|
||||
" id <VLAN ID>\n"
|
||||
" [flags <VLAN flags>]\n"
|
||||
" [ingress <ingress priority mapping>]\n"
|
||||
" [egress <egress priority mapping>]\n"
|
||||
" [mtu <MTU>]\n\n"
|
||||
" bond: [mode balance-rr (0) | active-backup (1) | balance-xor (2) | "
|
||||
"broadcast (3) |\n"
|
||||
" 802.3ad (4) | balance-tlb (5) | balance-alb (6)]\n"
|
||||
" [primary <ifname>]\n"
|
||||
" [miimon <num>]\n"
|
||||
" [downdelay <num>]\n"
|
||||
" [updelay <num>]\n"
|
||||
" [arp-interval <num>]\n"
|
||||
" [arp-ip-target <num>]\n"
|
||||
" [lacp-rate slow (0) | fast (1)]\n\n"
|
||||
" bond-slave: controller <controller (ifname, or connection UUID or name)>\n"
|
||||
" [queue-id <0-65535>]\n\n"
|
||||
" team: [config <file>|<raw JSON data>]\n\n"
|
||||
" team-slave: controller <controller (ifname, or connection UUID or name)>\n"
|
||||
" [config <file>|<raw JSON data>]\n\n"
|
||||
" bridge: [stp yes|no]\n"
|
||||
" [priority <num>]\n"
|
||||
" [forward-delay <2-30>]\n"
|
||||
" [hello-time <1-10>]\n"
|
||||
" [max-age <6-40>]\n"
|
||||
" [ageing-time <0-1000000>]\n"
|
||||
" [multicast-snooping yes|no]\n"
|
||||
" [mac <MAC address>]\n\n"
|
||||
" bridge-slave: controller <controller (ifname, or connection UUID or name)>\n"
|
||||
" [priority <0-63>]\n"
|
||||
" [path-cost <1-65535>]\n"
|
||||
" [hairpin yes|no]\n\n"
|
||||
" vpn: vpn-type "
|
||||
"vpnc|openvpn|pptp|openconnect|openswan|libreswan|ssh|l2tp|iodine|...\n"
|
||||
" [user <username>]\n\n"
|
||||
" olpc-mesh: ssid <SSID>\n"
|
||||
" [channel <1-13>]\n"
|
||||
" [dhcp-anycast <MAC address>]\n\n"
|
||||
" adsl: username <username>\n"
|
||||
" protocol pppoa|pppoe|ipoatm\n"
|
||||
" [password <password>]\n"
|
||||
" [encapsulation vcmux|llc]\n\n"
|
||||
" tun: mode tun|tap\n"
|
||||
" [owner <UID>]\n"
|
||||
" [group <GID>]\n"
|
||||
" [pi yes|no]\n"
|
||||
" [vnet-hdr yes|no]\n"
|
||||
" [multi-queue yes|no]\n\n"
|
||||
" ip-tunnel: mode ipip|gre|sit|isatap|vti|ip6ip6|ipip6|ip6gre|vti6\n"
|
||||
" remote <remote endpoint IP>\n"
|
||||
" [local <local endpoint IP>]\n"
|
||||
" [dev <parent device (ifname or connection UUID)>]\n\n"
|
||||
" macsec: dev <parent device (connection UUID, ifname, or MAC)>\n"
|
||||
" mode <psk|eap>\n"
|
||||
" [cak <key> ckn <key>]\n"
|
||||
" [encrypt yes|no]\n"
|
||||
" [port 1-65534]\n\n\n"
|
||||
" macvlan: dev <parent device (connection UUID, ifname, or MAC)>\n"
|
||||
" mode vepa|bridge|private|passthru|source\n"
|
||||
" [tap yes|no]\n\n"
|
||||
" vxlan: id <VXLAN ID>\n"
|
||||
" [remote <IP of multicast group or remote address>]\n"
|
||||
" [local <source IP>]\n"
|
||||
" [dev <parent device (ifname or connection UUID)>]\n"
|
||||
" [source-port-min <0-65535>]\n"
|
||||
" [source-port-max <0-65535>]\n"
|
||||
" [destination-port <0-65535>]\n\n"
|
||||
" wpan: [short-addr <0x0000-0xffff>]\n"
|
||||
" [pan-id <0x0000-0xffff>]\n"
|
||||
" [page <default|0-31>]\n"
|
||||
" [channel <default|0-26>]\n"
|
||||
" [mac <MAC address>]\n\n"
|
||||
" 6lowpan: dev <parent device (connection UUID, ifname, or MAC)>\n"
|
||||
" dummy:\n\n"
|
||||
" SLAVE_OPTIONS:\n"
|
||||
" bridge: [priority <0-63>]\n"
|
||||
" [path-cost <1-65535>]\n"
|
||||
" [hairpin yes|no]\n\n"
|
||||
" team: [config <file>|<raw JSON data>]\n\n"
|
||||
" bond: [queue-id <0-65535>]\n\n"
|
||||
" IP_OPTIONS:\n"
|
||||
" [ip4 <IPv4 address>] [gw4 <IPv4 gateway>]\n"
|
||||
" [ip6 <IPv6 address>] [gw6 <IPv6 gateway>]\n\n"));
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
@ -3989,7 +3990,8 @@ normalized_controller_for_port(const GPtrArray *connections,
|
|||
}
|
||||
|
||||
if (!out_controller) {
|
||||
nmc_print(_("Warning: master='%s' doesn't refer to any existing profile.\n"), controller);
|
||||
nmc_print(_("Warning: controller='%s' doesn't refer to any existing profile.\n"),
|
||||
controller);
|
||||
out_controller = controller;
|
||||
if (out_type)
|
||||
*out_type = type;
|
||||
|
|
@ -4690,7 +4692,7 @@ set_connection_controller(NmCli *nmc,
|
|||
g_set_error_literal(error,
|
||||
NMCLI_ERROR,
|
||||
NMC_RESULT_ERROR_USER_INPUT,
|
||||
_("Error: master is required"));
|
||||
_("Error: controller is required"));
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -762,12 +762,12 @@ const NmcMetaGenericInfo *const nmc_fields_dev_wimax_list[] = {
|
|||
#define NMC_FIELDS_DEV_WIMAX_LIST_COMMON "NSP,SIGNAL,TYPE,DEVICE,ACTIVE"
|
||||
#define NMC_FIELDS_DEV_WIMAX_LIST_FOR_DEV_LIST "NAME," NMC_FIELDS_DEV_WIMAX_LIST_COMMON
|
||||
|
||||
const NmcMetaGenericInfo *const nmc_fields_dev_show_master_prop[] = {
|
||||
const NmcMetaGenericInfo *const nmc_fields_dev_show_controller_prop[] = {
|
||||
NMC_META_GENERIC("NAME"), /* 0 */
|
||||
NMC_META_GENERIC("SLAVES"), /* 1 */
|
||||
NULL,
|
||||
};
|
||||
#define NMC_FIELDS_DEV_SHOW_MASTER_PROP_COMMON "NAME,SLAVES"
|
||||
#define NMC_FIELDS_DEV_SHOW_CONTROLLER_PROP_COMMON "NAME,SLAVES"
|
||||
|
||||
const NmcMetaGenericInfo *const nmc_fields_dev_show_team_prop[] = {
|
||||
NMC_META_GENERIC("NAME"), /* 0 */
|
||||
|
|
@ -802,18 +802,18 @@ const NmcMetaGenericInfo *const nmc_fields_dev_show_sections[] = {
|
|||
NMC_META_GENERIC_WITH_NESTED("WIRED-PROPERTIES",
|
||||
metagen_device_detail_wired_properties), /* 5 */
|
||||
NMC_META_GENERIC_WITH_NESTED("WIMAX-PROPERTIES",
|
||||
metagen_device_detail_wimax_properties), /* 6 */
|
||||
NMC_META_GENERIC_WITH_NESTED("NSP", nmc_fields_dev_wimax_list + 1), /* 7 */
|
||||
NMC_META_GENERIC_WITH_NESTED("IP4", metagen_ip4_config), /* 8 */
|
||||
NMC_META_GENERIC_WITH_NESTED("DHCP4", metagen_dhcp_config), /* 9 */
|
||||
NMC_META_GENERIC_WITH_NESTED("IP6", metagen_ip6_config), /* 10 */
|
||||
NMC_META_GENERIC_WITH_NESTED("DHCP6", metagen_dhcp_config), /* 11 */
|
||||
NMC_META_GENERIC_WITH_NESTED("BOND", nmc_fields_dev_show_master_prop + 1), /* 12 */
|
||||
NMC_META_GENERIC_WITH_NESTED("TEAM", nmc_fields_dev_show_team_prop + 1), /* 13 */
|
||||
NMC_META_GENERIC_WITH_NESTED("BRIDGE", nmc_fields_dev_show_master_prop + 1), /* 14 */
|
||||
NMC_META_GENERIC_WITH_NESTED("VLAN", nmc_fields_dev_show_vlan_prop + 1), /* 15 */
|
||||
NMC_META_GENERIC_WITH_NESTED("BLUETOOTH", nmc_fields_dev_show_bluetooth + 1), /* 16 */
|
||||
NMC_META_GENERIC_WITH_NESTED("CONNECTIONS", metagen_device_detail_connections), /* 17 */
|
||||
metagen_device_detail_wimax_properties), /* 6 */
|
||||
NMC_META_GENERIC_WITH_NESTED("NSP", nmc_fields_dev_wimax_list + 1), /* 7 */
|
||||
NMC_META_GENERIC_WITH_NESTED("IP4", metagen_ip4_config), /* 8 */
|
||||
NMC_META_GENERIC_WITH_NESTED("DHCP4", metagen_dhcp_config), /* 9 */
|
||||
NMC_META_GENERIC_WITH_NESTED("IP6", metagen_ip6_config), /* 10 */
|
||||
NMC_META_GENERIC_WITH_NESTED("DHCP6", metagen_dhcp_config), /* 11 */
|
||||
NMC_META_GENERIC_WITH_NESTED("BOND", nmc_fields_dev_show_controller_prop + 1), /* 12 */
|
||||
NMC_META_GENERIC_WITH_NESTED("TEAM", nmc_fields_dev_show_team_prop + 1), /* 13 */
|
||||
NMC_META_GENERIC_WITH_NESTED("BRIDGE", nmc_fields_dev_show_controller_prop + 1), /* 14 */
|
||||
NMC_META_GENERIC_WITH_NESTED("VLAN", nmc_fields_dev_show_vlan_prop + 1), /* 15 */
|
||||
NMC_META_GENERIC_WITH_NESTED("BLUETOOTH", nmc_fields_dev_show_bluetooth + 1), /* 16 */
|
||||
NMC_META_GENERIC_WITH_NESTED("CONNECTIONS", metagen_device_detail_connections), /* 17 */
|
||||
NULL,
|
||||
};
|
||||
#define NMC_FIELDS_DEV_SHOW_SECTIONS_COMMON \
|
||||
|
|
@ -1511,7 +1511,7 @@ print_bond_bridge_info(NMDevice *device,
|
|||
if (ports_str->len > 0)
|
||||
g_string_truncate(ports_str, ports_str->len - 1); /* Chop off last space */
|
||||
|
||||
tmpl = (const NMMetaAbstractInfo *const *) nmc_fields_dev_show_master_prop;
|
||||
tmpl = (const NMMetaAbstractInfo *const *) nmc_fields_dev_show_controller_prop;
|
||||
out_indices = parse_output_fields(one_field, tmpl, FALSE, NULL, NULL);
|
||||
arr = nmc_dup_fields_array(tmpl, NMC_OF_FLAG_FIELD_NAMES);
|
||||
g_ptr_array_add(out.output_data, arr);
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ extern const NmcMetaGenericInfo *const metagen_device_detail_wifi_properties[];
|
|||
extern const NmcMetaGenericInfo *const metagen_device_detail_wimax_properties[];
|
||||
extern const NmcMetaGenericInfo *const nmc_fields_dev_wifi_list[];
|
||||
extern const NmcMetaGenericInfo *const nmc_fields_dev_wimax_list[];
|
||||
extern const NmcMetaGenericInfo *const nmc_fields_dev_show_master_prop[];
|
||||
extern const NmcMetaGenericInfo *const nmc_fields_dev_show_controller_prop[];
|
||||
extern const NmcMetaGenericInfo *const nmc_fields_dev_show_team_prop[];
|
||||
extern const NmcMetaGenericInfo *const nmc_fields_dev_show_vlan_prop[];
|
||||
extern const NmcMetaGenericInfo *const nmc_fields_dev_show_bluetooth[];
|
||||
|
|
|
|||
|
|
@ -671,11 +671,11 @@
|
|||
format="string" />
|
||||
<property name="master"
|
||||
alias="master"
|
||||
nmcli-description="Interface name of the master device or UUID of the master connection. Deprecated 1.46. Use "controller" instead, this is just an alias."
|
||||
nmcli-description="Interface name of the controller device or UUID of the controller connection. Deprecated 1.46. Use "controller" instead, this is just an alias."
|
||||
format="string" />
|
||||
<property name="slave-type"
|
||||
alias="slave-type"
|
||||
nmcli-description="Setting name of the device type of this slave's master connection (eg, "bond"), or NULL if this connection is not a slave. Deprecated 1.46. Use "port-type" instead, this is just an alias."
|
||||
nmcli-description="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."
|
||||
format="string"
|
||||
values="bond, bridge, ovs-bridge, ovs-port, team, vrf" />
|
||||
<property name="port-type"
|
||||
|
|
@ -684,7 +684,7 @@
|
|||
format="string"
|
||||
values="bond, bridge, ovs-bridge, ovs-port, team, vrf" />
|
||||
<property name="autoconnect-slaves"
|
||||
nmcli-description="Whether or not slaves of this connection should be automatically brought up when NetworkManager activates this connection. This only has a real effect for master 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."
|
||||
nmcli-description="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."
|
||||
format="choice (NMSettingConnectionAutoconnectSlaves)"
|
||||
values="default (-1), no (0), yes (1)" />
|
||||
<property name="autoconnect-ports"
|
||||
|
|
@ -2038,7 +2038,7 @@
|
|||
values="0 - 4095" />
|
||||
<property name="flags"
|
||||
alias="flags"
|
||||
nmcli-description="One or more flags which control the behavior and features of the VLAN interface. Flags include "reorder-headers" (0x1) (reordering of output packet headers), "gvrp" (0x2) (use of the GVRP protocol), and "loose-binding" (0x4) (loose binding of the interface to its master device's operating state). "mvrp" (0x8) (use of the MVRP protocol). The default value of this property is NM_VLAN_FLAG_REORDER_HEADERS, but it used to be 0. To preserve backward compatibility, the default-value in the D-Bus API continues to be 0 and a missing property on D-Bus is still considered as 0."
|
||||
nmcli-description="One or more flags which control the behavior and features of the VLAN interface. Flags include "reorder-headers" (0x1) (reordering of output packet headers), "gvrp" (0x2) (use of the GVRP protocol), and "loose-binding" (0x4) (loose binding of the interface to its controller device's operating state). "mvrp" (0x8) (use of the MVRP protocol). The default value of this property is NM_VLAN_FLAG_REORDER_HEADERS, but it used to be 0. To preserve backward compatibility, the default-value in the D-Bus API continues to be 0 and a missing property on D-Bus is still considered as 0."
|
||||
format="flags (NMVlanFlags)"
|
||||
values="reorder-headers (0x1), gvrp (0x2), loose-binding (0x4), mvrp (0x8)" />
|
||||
<property name="protocol"
|
||||
|
|
|
|||
|
|
@ -1426,7 +1426,7 @@ ac_overview(NmCli *nmc, NMActiveConnection *ac)
|
|||
if (nm_active_connection_get_controller(ac)) {
|
||||
nm_str_buf_append_printf(&str,
|
||||
"%s %s, ",
|
||||
_("master"),
|
||||
_("controller"),
|
||||
nm_device_get_iface(nm_active_connection_get_controller(ac)));
|
||||
}
|
||||
if (nm_active_connection_get_vpn(ac))
|
||||
|
|
|
|||
|
|
@ -202,7 +202,7 @@ complete_fields(const char *option, const char *prefix)
|
|||
complete_field(h, metagen_device_detail_wimax_properties);
|
||||
complete_field(h, nmc_fields_dev_wifi_list);
|
||||
complete_field(h, nmc_fields_dev_wimax_list);
|
||||
complete_field(h, nmc_fields_dev_show_master_prop);
|
||||
complete_field(h, nmc_fields_dev_show_controller_prop);
|
||||
complete_field(h, nmc_fields_dev_show_team_prop);
|
||||
complete_field(h, nmc_fields_dev_show_vlan_prop);
|
||||
complete_field(h, nmc_fields_dev_show_bluetooth);
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ static guint signals[LAST_SIGNAL] = {0};
|
|||
|
||||
/**
|
||||
* nmt_wireguard_peer_list_new:
|
||||
* @master: the master #NMSettingWireGuard whose peers are being listed
|
||||
* @controller: the controller #NMSettingWireGuard whose peers are being listed
|
||||
*
|
||||
* Creates a new #NmtWireguardPeerList.
|
||||
*
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue