diff options
| author | Michael Biebl <biebl@debian.org> | 2019-03-26 23:25:23 +0100 |
|---|---|---|
| committer | Michael Biebl <biebl@debian.org> | 2019-03-26 23:25:23 +0100 |
| commit | 9a6dcbf895f9da01768e64b73cec88c16157d91e (patch) | |
| tree | a359958930d731e9f1b59344642e10754419fe84 /src/devices/adsl | |
| parent | 964ae8cc391520440cf5aa13e2b9cc34850ea6c2 (diff) | |
New upstream version 1.16.0 upstream/1.16.0
Diffstat (limited to 'src/devices/adsl')
| -rw-r--r-- | src/devices/adsl/meson.build | 6 | ||||
| -rw-r--r-- | src/devices/adsl/nm-atm-manager.c | 1 | ||||
| -rw-r--r-- | src/devices/adsl/nm-device-adsl.c | 41 |
3 files changed, 31 insertions, 17 deletions
diff --git a/src/devices/adsl/meson.build b/src/devices/adsl/meson.build index 7ac0e123..f92e809c 100644 --- a/src/devices/adsl/meson.build +++ b/src/devices/adsl/meson.build @@ -1,11 +1,11 @@ sources = files( 'nm-atm-manager.c', - 'nm-device-adsl.c' + 'nm-device-adsl.c', ) deps = [ libudev_dep, - nm_dep + nm_dep, ] libnm_device_plugin_adsl = shared_module( @@ -15,7 +15,7 @@ libnm_device_plugin_adsl = shared_module( link_args: ldflags_linker_script_devices, link_depends: linker_script_devices, install: true, - install_dir: nm_plugindir + install_dir: nm_plugindir, ) core_plugins += libnm_device_plugin_adsl diff --git a/src/devices/adsl/nm-atm-manager.c b/src/devices/adsl/nm-atm-manager.c index 0ff4603d..dddb8342 100644 --- a/src/devices/adsl/nm-atm-manager.c +++ b/src/devices/adsl/nm-atm-manager.c @@ -20,7 +20,6 @@ #include "nm-default.h" -#include <string.h> #include <gmodule.h> #include <libudev.h> diff --git a/src/devices/adsl/nm-device-adsl.c b/src/devices/adsl/nm-device-adsl.c index c9984f51..b3b87dc7 100644 --- a/src/devices/adsl/nm-device-adsl.c +++ b/src/devices/adsl/nm-device-adsl.c @@ -25,13 +25,12 @@ #include <sys/socket.h> #include <linux/atmdev.h> #include <linux/atmbr2684.h> -#include <errno.h> #include <sys/ioctl.h> #include <sys/types.h> #include <unistd.h> #include <stdlib.h> -#include <string.h> +#include "nm-ip4-config.h" #include "devices/nm-device-private.h" #include "platform/nm-platform.h" #include "ppp/nm-ppp-manager-call.h" @@ -259,8 +258,9 @@ pppoe_vcc_config (NMDeviceAdsl *self) NMDevice *device = NM_DEVICE (self); NMSettingAdsl *s_adsl; - s_adsl = nm_connection_get_setting_adsl (nm_device_get_applied_connection (device)); - g_assert (s_adsl); + s_adsl = nm_device_get_applied_setting (device, NM_TYPE_SETTING_ADSL); + + g_return_val_if_fail (s_adsl, FALSE); /* Set up the VCC */ if (!br2684_assign_vcc (self, s_adsl)) @@ -370,8 +370,8 @@ br2684_create_iface (NMDeviceAdsl *self, priv->nas_update_id = g_timeout_add (100, nas_update_cb, self); return NM_ACT_STAGE_RETURN_POSTPONE; } - if (errno != EEXIST) { - errsv = errno; + errsv = errno; + if (errsv != EEXIST) { _LOGW (LOGD_ADSL, "failed to create br2684 interface (%d)", errsv); break; } @@ -389,7 +389,8 @@ act_stage2_config (NMDevice *device, NMDeviceStateReason *out_failure_reason) NMSettingAdsl *s_adsl; const char *protocol; - s_adsl = nm_connection_get_setting_adsl (nm_device_get_applied_connection (device)); + s_adsl = nm_device_get_applied_setting (device, NM_TYPE_SETTING_ADSL); + g_return_val_if_fail (s_adsl, NM_ACT_STAGE_RETURN_FAILURE); protocol = nm_setting_adsl_get_protocol (s_adsl); @@ -447,9 +448,8 @@ ppp_ip4_config (NMPPPManager *ppp_manager, NMDevice *device = NM_DEVICE (user_data); /* Ignore PPP IP4 events that come in after initial configuration */ - if (nm_device_activate_ip4_state_in_conf (device)) { - nm_device_activate_schedule_ip4_config_result (device, config); - } + if (nm_device_activate_ip4_state_in_conf (device)) + nm_device_activate_schedule_ip_config_result (device, AF_INET, NM_IP_CONFIG_CAST (config)); } static NMActStageReturn @@ -465,8 +465,11 @@ act_stage3_ip4_config_start (NMDevice *device, const char *ppp_iface; req = nm_device_get_act_request (device); + g_return_val_if_fail (req, NM_ACT_STAGE_RETURN_FAILURE); - s_adsl = (NMSettingAdsl *) nm_device_get_applied_setting (device, NM_TYPE_SETTING_ADSL); + + s_adsl = nm_device_get_applied_setting (device, NM_TYPE_SETTING_ADSL); + g_return_val_if_fail (s_adsl, NM_ACT_STAGE_RETURN_FAILURE); /* PPPoE uses the NAS interface, not the ATM interface */ @@ -515,6 +518,18 @@ act_stage3_ip4_config_start (NMDevice *device, return NM_ACT_STAGE_RETURN_POSTPONE; } +static NMActStageReturn +act_stage3_ip_config_start (NMDevice *device, + int addr_family, + gpointer *out_config, + NMDeviceStateReason *out_failure_reason) +{ + if (addr_family == AF_INET) + return act_stage3_ip4_config_start (device, (NMIP4Config **) out_config, out_failure_reason); + + return NM_DEVICE_CLASS (nm_device_adsl_parent_class)->act_stage3_ip_config_start (device, addr_family, out_config, out_failure_reason); +} + static void adsl_cleanup (NMDeviceAdsl *self) { @@ -523,7 +538,7 @@ adsl_cleanup (NMDeviceAdsl *self) if (priv->ppp_manager) { g_signal_handlers_disconnect_by_func (priv->ppp_manager, G_CALLBACK (ppp_state_changed), self); g_signal_handlers_disconnect_by_func (priv->ppp_manager, G_CALLBACK (ppp_ip4_config), self); - nm_ppp_manager_stop (priv->ppp_manager, NULL, NULL); + nm_ppp_manager_stop (priv->ppp_manager, NULL, NULL, NULL); g_clear_object (&priv->ppp_manager); } @@ -684,7 +699,7 @@ nm_device_adsl_class_init (NMDeviceAdslClass *klass) device_class->complete_connection = complete_connection; device_class->act_stage2_config = act_stage2_config; - device_class->act_stage3_ip4_config_start = act_stage3_ip4_config_start; + device_class->act_stage3_ip_config_start = act_stage3_ip_config_start; device_class->deactivate = deactivate; obj_properties[PROP_ATM_INDEX] = |