device/trivial: rename local variable for device in "nm-device-{ethernet,macvlan}.c"
This variable is commonly called "device", not "dev". Rename.
This commit is contained in:
@@ -496,17 +496,17 @@ link_timeout_cb (gpointer user_data)
|
|||||||
{
|
{
|
||||||
NMDeviceEthernet *self = NM_DEVICE_ETHERNET (user_data);
|
NMDeviceEthernet *self = NM_DEVICE_ETHERNET (user_data);
|
||||||
NMDeviceEthernetPrivate *priv = NM_DEVICE_ETHERNET_GET_PRIVATE (self);
|
NMDeviceEthernetPrivate *priv = NM_DEVICE_ETHERNET_GET_PRIVATE (self);
|
||||||
NMDevice *dev = NM_DEVICE (self);
|
NMDevice *device = NM_DEVICE (self);
|
||||||
NMActRequest *req;
|
NMActRequest *req;
|
||||||
NMConnection *applied_connection;
|
NMConnection *applied_connection;
|
||||||
const char *setting_name;
|
const char *setting_name;
|
||||||
|
|
||||||
priv->supplicant_timeout_id = 0;
|
priv->supplicant_timeout_id = 0;
|
||||||
|
|
||||||
req = nm_device_get_act_request (dev);
|
req = nm_device_get_act_request (device);
|
||||||
|
|
||||||
if (nm_device_get_state (dev) == NM_DEVICE_STATE_ACTIVATED) {
|
if (nm_device_get_state (device) == NM_DEVICE_STATE_ACTIVATED) {
|
||||||
nm_device_state_changed (dev,
|
nm_device_state_changed (device,
|
||||||
NM_DEVICE_STATE_FAILED,
|
NM_DEVICE_STATE_FAILED,
|
||||||
NM_DEVICE_STATE_REASON_SUPPLICANT_TIMEOUT);
|
NM_DEVICE_STATE_REASON_SUPPLICANT_TIMEOUT);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
@@ -516,7 +516,7 @@ link_timeout_cb (gpointer user_data)
|
|||||||
* ARE checked - we are likely to have wrong key. Ask the user for
|
* ARE checked - we are likely to have wrong key. Ask the user for
|
||||||
* another one.
|
* another one.
|
||||||
*/
|
*/
|
||||||
if (nm_device_get_state (dev) != NM_DEVICE_STATE_CONFIG)
|
if (nm_device_get_state (device) != NM_DEVICE_STATE_CONFIG)
|
||||||
goto time_out;
|
goto time_out;
|
||||||
|
|
||||||
nm_active_connection_clear_secrets (NM_ACTIVE_CONNECTION (req));
|
nm_active_connection_clear_secrets (NM_ACTIVE_CONNECTION (req));
|
||||||
@@ -530,14 +530,14 @@ link_timeout_cb (gpointer user_data)
|
|||||||
"Activation: (ethernet) disconnected during authentication, asking for new key.");
|
"Activation: (ethernet) disconnected during authentication, asking for new key.");
|
||||||
supplicant_interface_release (self);
|
supplicant_interface_release (self);
|
||||||
|
|
||||||
nm_device_state_changed (dev, NM_DEVICE_STATE_NEED_AUTH, NM_DEVICE_STATE_REASON_SUPPLICANT_DISCONNECT);
|
nm_device_state_changed (device, NM_DEVICE_STATE_NEED_AUTH, NM_DEVICE_STATE_REASON_SUPPLICANT_DISCONNECT);
|
||||||
wired_secrets_get_secrets (self, setting_name, NM_SECRET_AGENT_GET_SECRETS_FLAG_REQUEST_NEW);
|
wired_secrets_get_secrets (self, setting_name, NM_SECRET_AGENT_GET_SECRETS_FLAG_REQUEST_NEW);
|
||||||
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
time_out:
|
time_out:
|
||||||
_LOGW (LOGD_DEVICE | LOGD_ETHER, "link timed out.");
|
_LOGW (LOGD_DEVICE | LOGD_ETHER, "link timed out.");
|
||||||
nm_device_state_changed (dev, NM_DEVICE_STATE_FAILED, NM_DEVICE_STATE_REASON_SUPPLICANT_DISCONNECT);
|
nm_device_state_changed (device, NM_DEVICE_STATE_FAILED, NM_DEVICE_STATE_REASON_SUPPLICANT_DISCONNECT);
|
||||||
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
@@ -857,19 +857,19 @@ pppoe_reconnect_delay (gpointer user_data)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static NMActStageReturn
|
static NMActStageReturn
|
||||||
act_stage1_prepare (NMDevice *dev, NMDeviceStateReason *out_failure_reason)
|
act_stage1_prepare (NMDevice *device, NMDeviceStateReason *out_failure_reason)
|
||||||
{
|
{
|
||||||
NMDeviceEthernet *self = NM_DEVICE_ETHERNET (dev);
|
NMDeviceEthernet *self = NM_DEVICE_ETHERNET (device);
|
||||||
NMDeviceEthernetPrivate *priv = NM_DEVICE_ETHERNET_GET_PRIVATE (self);
|
NMDeviceEthernetPrivate *priv = NM_DEVICE_ETHERNET_GET_PRIVATE (self);
|
||||||
NMActStageReturn ret;
|
NMActStageReturn ret;
|
||||||
|
|
||||||
ret = NM_DEVICE_CLASS (nm_device_ethernet_parent_class)->act_stage1_prepare (dev, out_failure_reason);
|
ret = NM_DEVICE_CLASS (nm_device_ethernet_parent_class)->act_stage1_prepare (device, out_failure_reason);
|
||||||
if (ret != NM_ACT_STAGE_RETURN_SUCCESS)
|
if (ret != NM_ACT_STAGE_RETURN_SUCCESS)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
link_negotiation_set (dev);
|
link_negotiation_set (device);
|
||||||
|
|
||||||
if (!nm_device_hw_addr_set_cloned (dev, nm_device_get_applied_connection (dev), FALSE))
|
if (!nm_device_hw_addr_set_cloned (device, nm_device_get_applied_connection (device), FALSE))
|
||||||
return NM_ACT_STAGE_RETURN_FAILURE;
|
return NM_ACT_STAGE_RETURN_FAILURE;
|
||||||
|
|
||||||
/* If we're re-activating a PPPoE connection a short while after
|
/* If we're re-activating a PPPoE connection a short while after
|
||||||
@@ -885,7 +885,7 @@ act_stage1_prepare (NMDevice *dev, NMDeviceStateReason *out_failure_reason)
|
|||||||
gint32 delay = nm_utils_get_monotonic_timestamp_s () - priv->last_pppoe_time;
|
gint32 delay = nm_utils_get_monotonic_timestamp_s () - priv->last_pppoe_time;
|
||||||
|
|
||||||
if ( delay < PPPOE_RECONNECT_DELAY
|
if ( delay < PPPOE_RECONNECT_DELAY
|
||||||
&& nm_device_get_applied_setting (dev, NM_TYPE_SETTING_PPPOE)) {
|
&& nm_device_get_applied_setting (device, NM_TYPE_SETTING_PPPOE)) {
|
||||||
if (priv->pppoe_wait_id == 0) {
|
if (priv->pppoe_wait_id == 0) {
|
||||||
_LOGI (LOGD_DEVICE, "delaying PPPoE reconnect for %d seconds to ensure peer is ready...",
|
_LOGI (LOGD_DEVICE, "delaying PPPoE reconnect for %d seconds to ensure peer is ready...",
|
||||||
delay);
|
delay);
|
||||||
|
@@ -270,7 +270,7 @@ create_and_realize (NMDevice *device,
|
|||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
static NMDeviceCapabilities
|
static NMDeviceCapabilities
|
||||||
get_generic_capabilities (NMDevice *dev)
|
get_generic_capabilities (NMDevice *device)
|
||||||
{
|
{
|
||||||
/* We assume MACVLAN interfaces always support carrier detect */
|
/* We assume MACVLAN interfaces always support carrier detect */
|
||||||
return NM_DEVICE_CAP_CARRIER_DETECT | NM_DEVICE_CAP_IS_SOFTWARE;
|
return NM_DEVICE_CAP_CARRIER_DETECT | NM_DEVICE_CAP_IS_SOFTWARE;
|
||||||
@@ -416,16 +416,17 @@ update_connection (NMDevice *device, NMConnection *connection)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static NMActStageReturn
|
static NMActStageReturn
|
||||||
act_stage1_prepare (NMDevice *dev, NMDeviceStateReason *out_failure_reason)
|
act_stage1_prepare (NMDevice *device, NMDeviceStateReason *out_failure_reason)
|
||||||
{
|
{
|
||||||
NMActStageReturn ret;
|
NMActStageReturn ret;
|
||||||
|
|
||||||
ret = NM_DEVICE_CLASS (nm_device_macvlan_parent_class)->act_stage1_prepare (dev, out_failure_reason);
|
ret = NM_DEVICE_CLASS (nm_device_macvlan_parent_class)->act_stage1_prepare (device, out_failure_reason);
|
||||||
if (ret != NM_ACT_STAGE_RETURN_SUCCESS)
|
if (ret != NM_ACT_STAGE_RETURN_SUCCESS)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
if (!nm_device_hw_addr_set_cloned (dev, nm_device_get_applied_connection (dev), FALSE))
|
if (!nm_device_hw_addr_set_cloned (device, nm_device_get_applied_connection (device), FALSE))
|
||||||
return NM_ACT_STAGE_RETURN_FAILURE;
|
return NM_ACT_STAGE_RETURN_FAILURE;
|
||||||
|
|
||||||
return NM_ACT_STAGE_RETURN_SUCCESS;
|
return NM_ACT_STAGE_RETURN_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user