device: add "is_manual" argument to ready_for_ip_config() device method

Some device types might want to run manual ip configuration while
skipping other methods.

(cherry picked from commit 2ae8433520)
(cherry picked from commit 2128e4542e)
This commit is contained in:
Beniamino Galvani 2022-07-15 10:43:53 +02:00
parent ace95e5113
commit 8388f67d3d
6 changed files with 7 additions and 7 deletions

View file

@ -11628,7 +11628,7 @@ activate_stage3_ip_config_for_addr_family(NMDevice *self, int addr_family, const
priv->ip_data_x[IS_IPv4].wait_for_ports = FALSE;
}
if (klass->ready_for_ip_config && !klass->ready_for_ip_config(self))
if (klass->ready_for_ip_config && !klass->ready_for_ip_config(self, FALSE))
goto out_devip;
if (IS_IPv4) {
@ -11892,7 +11892,7 @@ activate_stage3_ip_config(NMDevice *self)
}
if (!nm_device_sys_iface_state_is_external(self)
&& (!klass->ready_for_ip_config || klass->ready_for_ip_config(self))) {
&& (!klass->ready_for_ip_config || klass->ready_for_ip_config(self, TRUE))) {
if (priv->ipmanual_data.state_6 == NM_DEVICE_IP_STATE_NONE
&& !NM_IN_STRSET(ipv6_method,
NM_SETTING_IP6_CONFIG_METHOD_DISABLED,

View file

@ -346,7 +346,7 @@ typedef struct _NMDeviceClass {
NMActStageReturn (*act_stage1_prepare)(NMDevice *self, NMDeviceStateReason *out_failure_reason);
NMActStageReturn (*act_stage2_config)(NMDevice *self, NMDeviceStateReason *out_failure_reason);
void (*act_stage3_ip_config)(NMDevice *self, int addr_family);
gboolean (*ready_for_ip_config)(NMDevice *self);
gboolean (*ready_for_ip_config)(NMDevice *self, gboolean is_manual);
const char *(*get_ip_method_auto)(NMDevice *self, int addr_family);

View file

@ -67,7 +67,7 @@ get_generic_capabilities(NMDevice *device)
}
static gboolean
ready_for_ip_config(NMDevice *device)
ready_for_ip_config(NMDevice *device, gboolean is_manual)
{
return FALSE;
}

View file

@ -194,7 +194,7 @@ set_platform_mtu(NMDevice *device, guint32 mtu)
}
static gboolean
ready_for_ip_config(NMDevice *device)
ready_for_ip_config(NMDevice *device, gboolean is_manual)
{
return nm_device_get_ip_ifindex(device) > 0;
}

View file

@ -61,7 +61,7 @@ get_generic_capabilities(NMDevice *device)
}
static gboolean
ready_for_ip_config(NMDevice *device)
ready_for_ip_config(NMDevice *device, gboolean is_manual)
{
return FALSE;
}

View file

@ -621,7 +621,7 @@ is_available(NMDevice *device, NMDeviceCheckDevAvailableFlags flags)
}
static gboolean
ready_for_ip_config(NMDevice *device)
ready_for_ip_config(NMDevice *device, gboolean is_manual)
{
/* Tell NMDevice to only run device-specific IP
* configuration (devip) and skip other methods