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.
This commit is contained in:
@@ -11806,7 +11806,7 @@ activate_stage3_ip_config_for_addr_family(NMDevice *self, int addr_family, const
|
|||||||
priv->ip_data_x[IS_IPv4].wait_for_ports = FALSE;
|
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;
|
goto out_devip;
|
||||||
|
|
||||||
if (IS_IPv4) {
|
if (IS_IPv4) {
|
||||||
@@ -12073,7 +12073,7 @@ activate_stage3_ip_config(NMDevice *self)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!nm_device_sys_iface_state_is_external(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
|
if (priv->ipmanual_data.state_6 == NM_DEVICE_IP_STATE_NONE
|
||||||
&& !NM_IN_STRSET(ipv6_method,
|
&& !NM_IN_STRSET(ipv6_method,
|
||||||
NM_SETTING_IP6_CONFIG_METHOD_DISABLED,
|
NM_SETTING_IP6_CONFIG_METHOD_DISABLED,
|
||||||
|
@@ -347,7 +347,7 @@ typedef struct _NMDeviceClass {
|
|||||||
NMActStageReturn (*act_stage1_prepare)(NMDevice *self, NMDeviceStateReason *out_failure_reason);
|
NMActStageReturn (*act_stage1_prepare)(NMDevice *self, NMDeviceStateReason *out_failure_reason);
|
||||||
NMActStageReturn (*act_stage2_config)(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);
|
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);
|
const char *(*get_ip_method_auto)(NMDevice *self, int addr_family);
|
||||||
|
|
||||||
|
@@ -67,7 +67,7 @@ get_generic_capabilities(NMDevice *device)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
ready_for_ip_config(NMDevice *device)
|
ready_for_ip_config(NMDevice *device, gboolean is_manual)
|
||||||
{
|
{
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
@@ -198,7 +198,7 @@ set_platform_mtu(NMDevice *device, guint32 mtu)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
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;
|
return nm_device_get_ip_ifindex(device) > 0;
|
||||||
}
|
}
|
||||||
|
@@ -61,7 +61,7 @@ get_generic_capabilities(NMDevice *device)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
ready_for_ip_config(NMDevice *device)
|
ready_for_ip_config(NMDevice *device, gboolean is_manual)
|
||||||
{
|
{
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
@@ -621,7 +621,7 @@ is_available(NMDevice *device, NMDeviceCheckDevAvailableFlags flags)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
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
|
/* Tell NMDevice to only run device-specific IP
|
||||||
* configuration (devip) and skip other methods
|
* configuration (devip) and skip other methods
|
||||||
|
Reference in New Issue
Block a user