From bd6074095d11dff843e17071f41b0dbdacee34c4 Mon Sep 17 00:00:00 2001 From: Lubomir Rintel Date: Wed, 19 Sep 2018 19:18:26 +0200 Subject: [PATCH] devices/wpan: set channel on activation --- src/devices/nm-device-wpan.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/devices/nm-device-wpan.c b/src/devices/nm-device-wpan.c index 0fc48f030a..35352df12b 100644 --- a/src/devices/nm-device-wpan.c +++ b/src/devices/nm-device-wpan.c @@ -123,6 +123,7 @@ act_stage1_prepare (NMDevice *device, NMDeviceStateReason *out_failure_reason) NMPlatform *platform; guint16 pan_id; guint16 short_address; + gint16 page, channel; int ifindex; const guint8 *hwaddr; gsize hwaddr_len = 0; @@ -182,6 +183,15 @@ act_stage1_prepare (NMDevice *device, NMDeviceStateReason *out_failure_reason) } } + channel = nm_setting_wpan_get_channel (s_wpan); + if (channel != NM_SETTING_WPAN_CHANNEL_DEFAULT) { + page = nm_setting_wpan_get_page (s_wpan); + if (!nm_platform_wpan_set_channel (platform, ifindex, page, channel)) { + _LOGW (LOGD_DEVICE, "unable to set the channel"); + goto out; + } + } + ret = NM_ACT_STAGE_RETURN_SUCCESS; out: nm_device_bring_up (device, TRUE, NULL);