Fix a number of problems (mainly crashes)

rh #1261428, rh #1264676, rh #1263959, rh #1265993, rh #1266003, rh #1272974
This commit is contained in:
Jiří Klimeš 2015-10-19 13:13:30 +02:00
parent 67c159a277
commit bb5706276c
10 changed files with 532 additions and 1 deletions

View File

@ -8,7 +8,7 @@
%define ppp_version %(rpm -q ppp-devel >/dev/null && rpm -q --qf '%%{version}' ppp-devel || echo -n bad)
%define snapshot %{nil}
%define release_version 6
%define release_version 7
%define realversion 1.0.6
%define epoch_version 1
@ -93,6 +93,15 @@ Patch3: 0004-device-don-t-reset-NM_UNMANAGED_DEFAULT-when-platfor.patch
Patch4: 0001-test-fix-duplicate-test-names.patch
Patch5: rh1263185-nmcli-con-add-generic.patch
Patch6: 0001-vpn-connection-set-the-MTU-for-the-VPN-IP-interface.patch
Patch7: nmcli-crash-vlan-priorities.patch
Patch8: rh1261428-ipv6-ignore-auto-dns.patch
Patch9: rh1264676-fix-crash-on-device-removal.patch
Patch10: rh1263959-modem-supported-ip-families.patch
Patch11: rh1265993-nmcli-allow-ipv6-ppp-for-wwan.patch
Patch12: rh1266003-fix-crash-on-bss-proxy-acquired.patch
Patch13: nmtui-fix-crash-in-secret-agent.patch
Patch14: libnm-fix-introspection-annotation.patch
Patch15: rh1272974-fix-s390-ctc-detection.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
@ -376,6 +385,15 @@ by nm-connection-editor and nm-applet in a non-graphical environment.
%patch4 -p1
%patch5 -p1
%patch6 -p1
%patch7 -p1
%patch8 -p1
%patch9 -p1
%patch10 -p1
%patch11 -p1
%patch12 -p1
%patch13 -p1
%patch14 -p1
%patch15 -p1
%build
@ -694,6 +712,17 @@ fi
%endif
%changelog
* Mon Oct 19 2015 Jiří Klimeš <jklimes@redhat.com> - 1:1.0.6-7
- libnm-core: fix a crash in priority_strv_to_maplist()
- core: fix handling ignore-auto-dns for IPv6 nameservers (rh #1261428)
- manager: disconnect signal handlers on 'settings' in dispose() (rh #1264676)
- modem-broadband: update modem's supported-ip-families (rh #1263959)
- cli: allow 'ipv6' and 'ppp' settings for GSM and CDMA connections (rh #1265993)
- wifi: fix a crash in on_bss_proxy_acquired() (rh #1266003)
- tui: fix crash during activation when failed to create secret-agent (bgo #755883)
- libnm: specify (transfer none) introspection annotation (bgo #756380)
- platform: fix link-detection for s390 CTC-type devices (rh #1272974)
* Mon Sep 28 2015 Lubomir Rintel <lkundrak@v3.sk> - 1:1.0.6-6
- Fix the VPN MTU setup (rh #1244547)

View File

@ -0,0 +1,49 @@
From ba46efd07777350be737dbdac9df9becb86e8f77 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ji=C5=99=C3=AD=20Klime=C5=A1?= <jklimes@redhat.com>
Date: Mon, 12 Oct 2015 10:56:44 +0200
Subject: [PATCH] libnm: specify (transfer none) introspection annotation (bgo
#756380)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Otherwise the callers would free the address and it would result in
double-free.
Ideally, the function would return const pointer, but changing it now
would require changing also other prototypes and much code due to
snowball effect of const.
https://bugzilla.gnome.org/show_bug.cgi?id=756380
(cherry picked from commit 237030ce2bc23f39ccb4f72f94b3c98e2232ded4)
Signed-off-by: Jiří Klimeš <jklimes@redhat.com>
---
libnm-core/nm-setting-ip-config.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/libnm-core/nm-setting-ip-config.c b/libnm-core/nm-setting-ip-config.c
index 4b73d5f..58b5799 100644
--- a/libnm-core/nm-setting-ip-config.c
+++ b/libnm-core/nm-setting-ip-config.c
@@ -1415,7 +1415,7 @@ nm_setting_ip_config_get_num_addresses (NMSettingIPConfig *setting)
* @setting: the #NMSettingIPConfig
* @i: index number of the address to return
*
- * Returns: the address at index @i
+ * Returns: (transfer none): the address at index @i
**/
NMIPAddress *
nm_setting_ip_config_get_address (NMSettingIPConfig *setting, int i)
@@ -1567,7 +1567,7 @@ nm_setting_ip_config_get_num_routes (NMSettingIPConfig *setting)
* @setting: the #NMSettingIPConfig
* @i: index number of the route to return
*
- * Returns: the route at index @i
+ * Returns: (transfer none): the route at index @i
**/
NMIPRoute *
nm_setting_ip_config_get_route (NMSettingIPConfig *setting, int i)
--
2.1.0

View File

@ -0,0 +1,35 @@
From 7cfd6fc64185bebb09274107d64e65df748b149e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ji=C5=99=C3=AD=20Klime=C5=A1?= <jklimes@redhat.com>
Date: Tue, 1 Sep 2015 16:06:54 +0200
Subject: [PATCH] libnm-core: fix a crash in priority_strv_to_maplist()
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
strv can be NULL.
Reproducer:
$ nmcli con mod my-vlan vlan.ingress 1:5
(cherry picked from commit 71c8c2e5872d2c6b15e24d37d3c000c11d0eba07)
Signed-off-by: Jiří Klimeš <jklimes@redhat.com>
---
libnm-core/nm-setting-vlan.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libnm-core/nm-setting-vlan.c b/libnm-core/nm-setting-vlan.c
index 859eb13..cbc85b3 100644
--- a/libnm-core/nm-setting-vlan.c
+++ b/libnm-core/nm-setting-vlan.c
@@ -565,7 +565,7 @@ priority_strv_to_maplist (NMVlanPriorityMap map, char **strv)
GSList *list = NULL;
int i;
- for (i = 0; strv[i]; i++) {
+ for (i = 0; strv && strv[i]; i++) {
PriorityMap *item;
item = priority_map_new_from_str (map, strv[i]);
--
2.1.0

View File

@ -0,0 +1,88 @@
From 269a4483be917fcc7ba66bcf061f75e76df0c6c7 Mon Sep 17 00:00:00 2001
From: Thomas Haller <thaller@redhat.com>
Date: Wed, 30 Sep 2015 17:25:49 +0200
Subject: [PATCH] tui: fix crash during activation when failed to create
secret-agent
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
NetworkManager only allows one 'client:user-id' to register as secret
agent. Thus, when starting nmtui in two terminals, creating the secret
agent can fail.
This can lead to a crash.
https://bugzilla.gnome.org/show_bug.cgi?id=755883
(cherry picked from commit b861900d45da588f4239be418c3e1f62505cbde1)
Signed-off-by: Jiří Klimeš <jklimes@redhat.com>
---
clients/tui/nmtui-connect.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/clients/tui/nmtui-connect.c b/clients/tui/nmtui-connect.c
index 438915d..5eabbc8 100644
--- a/clients/tui/nmtui-connect.c
+++ b/clients/tui/nmtui-connect.c
@@ -132,7 +132,7 @@ activate_connection (NMConnection *connection,
NMObject *specific_object)
{
NmtNewtForm *form;
- NMSecretAgentOld *agent;
+ gs_unref_object NMSecretAgentOld *agent = NULL;
NmtNewtWidget *label;
NmtSyncOp op;
const char *specific_object_path;
@@ -188,7 +188,7 @@ activate_connection (NMConnection *connection,
goto done;
}
- if (!connection) {
+ if (agent && !connection) {
connection = NM_CONNECTION (nm_active_connection_get_connection (ac));
if (connection) {
nm_secret_agent_simple_enable (NM_SECRET_AGENT_SIMPLE (agent),
@@ -220,8 +220,8 @@ activate_connection (NMConnection *connection,
nmt_newt_form_quit (form);
g_object_unref (form);
- nm_secret_agent_old_unregister (agent, NULL, NULL);
- g_object_unref (agent);
+ if (agent)
+ nm_secret_agent_old_unregister (agent, NULL, NULL);
}
static void
--
2.1.0
From e88161172e2d675783027a839b50488cc75fbf6f Mon Sep 17 00:00:00 2001
From: Lubomir Rintel <lkundrak@v3.sk>
Date: Wed, 30 Sep 2015 19:37:10 +0200
Subject: [PATCH] tui: add a missing include to fix build
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Fixes: 269a4483be917fcc7ba66bcf061f75e76df0c6c7
Signed-off-by: Jiří Klimeš <jklimes@redhat.com>
---
clients/tui/nmtui-connect.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/clients/tui/nmtui-connect.c b/clients/tui/nmtui-connect.c
index 5eabbc8..cacb0b4 100644
--- a/clients/tui/nmtui-connect.c
+++ b/clients/tui/nmtui-connect.c
@@ -30,6 +30,8 @@
#include <glib/gi18n-lib.h>
+#include "gsystem-local-alloc.h"
+
#include "nmt-newt.h"
#include "nmtui.h"
--
2.1.0

View File

@ -0,0 +1,37 @@
From 8de6ee4ebad93cd1f552c666183a4fac76274aa5 Mon Sep 17 00:00:00 2001
From: Thomas Haller <thaller@redhat.com>
Date: Wed, 9 Sep 2015 12:59:01 +0200
Subject: [PATCH] core: fix handling ignore-auto-dns for IPv6 nameservers
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
https://bugzilla.redhat.com/show_bug.cgi?id=1261428
Fixes: f7a8962dd47099425438ee484e02f40e18b6ee79
(cherry picked from commit e0fe47b74e92e9614717a3d918eed3fc0bc6b2ea)
Signed-off-by: Jiří Klimeš <jklimes@redhat.com>
---
src/nm-ip6-config.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/nm-ip6-config.c b/src/nm-ip6-config.c
index 9647268..ef25623 100644
--- a/src/nm-ip6-config.c
+++ b/src/nm-ip6-config.c
@@ -635,8 +635,10 @@ nm_ip6_config_merge (NMIP6Config *dst, const NMIP6Config *src, NMIPConfigMergeFl
nm_ip6_config_add_address (dst, nm_ip6_config_get_address (src, i));
/* nameservers */
- for (i = 0; i < nm_ip6_config_get_num_nameservers (src); i++)
- nm_ip6_config_add_nameserver (dst, nm_ip6_config_get_nameserver (src, i));
+ if (!NM_FLAGS_HAS (merge_flags, NM_IP_CONFIG_MERGE_NO_DNS)) {
+ for (i = 0; i < nm_ip6_config_get_num_nameservers (src); i++)
+ nm_ip6_config_add_nameserver (dst, nm_ip6_config_get_nameserver (src, i));
+ }
/* default gateway */
if (nm_ip6_config_get_gateway (src))
--
2.1.0

View File

@ -0,0 +1,62 @@
From a0ffb5ad19dbc1a8aa95f72f79c604527bd8c83e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ji=C5=99=C3=AD=20Klime=C5=A1?= <jklimes@redhat.com>
Date: Tue, 22 Sep 2015 18:42:40 +0200
Subject: [PATCH] modem-broadband: update modem's supported-ip-families (rh
#1263959)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
If SIM in a modem is locked, ModemManager can't initialize SupportedIpFamilies
and NetworkManager will set the property to 0. ModemManager then updates the
property after the modem is unlocked, but NetworkManager did not watch changes
to the property. And that resulted in a connection failure:
(ttyUSB1): Failed to connect 'O2 Internet': Connection requested IPv4 but IPv4 is unsuported by the modem.
(ttyUSB1): device state change: prepare -> failed (reason 'modem-init-failed') [40 120 28]
https://bugzilla.redhat.com/show_bug.cgi?id=1263959
(cherry picked from commit eecb4c46cc35c43c12e84e530b3be50374baa792)
Signed-off-by: Jiří Klimeš <jklimes@redhat.com>
---
src/devices/wwan/nm-modem-broadband.c | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/src/devices/wwan/nm-modem-broadband.c b/src/devices/wwan/nm-modem-broadband.c
index 4bb72fd..ec4f4a2 100644
--- a/src/devices/wwan/nm-modem-broadband.c
+++ b/src/devices/wwan/nm-modem-broadband.c
@@ -1146,6 +1146,19 @@ sim_changed (MMModem *modem, GParamSpec *pspec, gpointer user_data)
}
static void
+supported_ip_families_changed (MMModem *modem, GParamSpec *pspec, gpointer user_data)
+{
+ NMModemBroadband *self = NM_MODEM_BROADBAND (user_data);
+
+ g_return_if_fail (modem == self->priv->modem_iface);
+
+ g_object_set (G_OBJECT (self),
+ NM_MODEM_IP_TYPES,
+ mm_ip_family_to_nm (mm_modem_get_supported_ip_families (modem)),
+ NULL);
+}
+
+static void
nm_modem_broadband_init (NMModemBroadband *self)
{
self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self,
@@ -1176,6 +1189,10 @@ set_property (GObject *object,
G_CALLBACK (sim_changed),
self);
sim_changed (self->priv->modem_iface, NULL, self);
+ g_signal_connect (self->priv->modem_iface,
+ "notify::supported-ip-families",
+ G_CALLBACK (supported_ip_families_changed),
+ self);
/* Note: don't grab the Simple iface here; the Modem interface is the
* only one assumed to be always valid and available */
--
2.1.0

View File

@ -0,0 +1,80 @@
From 117fd7ef515a60cf36acce970b21915f51f1074d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ji=C5=99=C3=AD=20Klime=C5=A1?= <jklimes@redhat.com>
Date: Mon, 21 Sep 2015 14:30:02 +0200
Subject: [PATCH 1/2] manager: disconnect signal handlers on 'settings' in
dispose() (rh #1264676)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Otherwise a crash can occur when shutting down.
https://bugzilla.redhat.com/show_bug.cgi?id=1264676
(cherry picked from commit dd8c3ef3a005613b5a28dd084bdae54dffa203fd)
Signed-off-by: Jiří Klimeš <jklimes@redhat.com>
---
src/nm-manager.c | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/src/nm-manager.c b/src/nm-manager.c
index d91a0d7..7589053 100644
--- a/src/nm-manager.c
+++ b/src/nm-manager.c
@@ -5115,7 +5115,16 @@ dispose (GObject *object)
g_clear_object (&priv->policy);
}
- g_clear_object (&priv->settings);
+ if (priv->settings) {
+ g_signal_handlers_disconnect_by_func (priv->settings, settings_startup_complete_changed, manager);
+ g_signal_handlers_disconnect_by_func (priv->settings, system_unmanaged_devices_changed_cb, manager);
+ g_signal_handlers_disconnect_by_func (priv->settings, system_hostname_changed_cb, manager);
+ g_signal_handlers_disconnect_by_func (priv->settings, connection_added, manager);
+ g_signal_handlers_disconnect_by_func (priv->settings, connection_changed, manager);
+ g_signal_handlers_disconnect_by_func (priv->settings, connection_removed, manager);
+ g_clear_object (&priv->settings);
+ }
+
g_free (priv->state_file);
g_clear_object (&priv->vpn_manager);
--
2.1.0
From b010870d8477c24e2846df4eeda81acdd00000e4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ji=C5=99=C3=AD=20Klime=C5=A1?= <jklimes@redhat.com>
Date: Mon, 21 Sep 2015 14:38:25 +0200
Subject: [PATCH 2/2] manager: cleanup NMRfkillManager in dispose()
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Fixes: b15fb8641e26eb63c2d83d9dcc9510705086e2f2
(cherry picked from commit 85d7dc1a0fe15996f4194d28378e9738b53c99c4)
Signed-off-by: Jiří Klimeš <jklimes@redhat.com>
---
src/nm-manager.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/src/nm-manager.c b/src/nm-manager.c
index 7589053..40e8321 100644
--- a/src/nm-manager.c
+++ b/src/nm-manager.c
@@ -5152,6 +5152,11 @@ dispose (GObject *object)
g_clear_object (&priv->fw_monitor);
}
+ if (priv->rfkill_mgr) {
+ g_signal_handlers_disconnect_by_func (priv->rfkill_mgr, rfkill_manager_rfkill_changed_cb, manager);
+ g_clear_object (&priv->rfkill_mgr);
+ }
+
nm_device_factory_manager_for_each_factory (_deinit_device_factory, manager);
if (priv->timestamp_update_id) {
--
2.1.0

View File

@ -0,0 +1,46 @@
From 1b253ee722b524c4ea4f34bf227672386fa83ade Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ji=C5=99=C3=AD=20Klime=C5=A1?= <jklimes@redhat.com>
Date: Fri, 25 Sep 2015 15:42:00 +0200
Subject: [PATCH] cli: allow 'ipv6' and 'ppp' settings for GSM and CDMA
connections (rh #1265993)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Otherwise the settings cannot be changed.
https://bugzilla.redhat.com/show_bug.cgi?id=1265993
(cherry picked from commit ecf084935590a86558e1cafe66f3faebbf2c5925)
Signed-off-by: Jiří Klimeš <jklimes@redhat.com>
---
clients/cli/connections.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/clients/cli/connections.c b/clients/cli/connections.c
index b6614ae..85b1c7d 100644
--- a/clients/cli/connections.c
+++ b/clients/cli/connections.c
@@ -2475,7 +2475,9 @@ static const NameItem nmc_gsm_settings [] = {
{ NM_SETTING_CONNECTION_SETTING_NAME, NULL, NULL, TRUE },
{ NM_SETTING_GSM_SETTING_NAME, NULL, NULL, TRUE },
{ NM_SETTING_SERIAL_SETTING_NAME, NULL, NULL, FALSE },
+ { NM_SETTING_PPP_SETTING_NAME, NULL, NULL, FALSE },
{ NM_SETTING_IP4_CONFIG_SETTING_NAME, NULL, NULL, FALSE },
+ { NM_SETTING_IP6_CONFIG_SETTING_NAME, NULL, NULL, FALSE },
{ NULL, NULL, NULL, FALSE }
};
@@ -2483,7 +2485,9 @@ static const NameItem nmc_cdma_settings [] = {
{ NM_SETTING_CONNECTION_SETTING_NAME, NULL, NULL, TRUE },
{ NM_SETTING_CDMA_SETTING_NAME, NULL, NULL, TRUE },
{ NM_SETTING_SERIAL_SETTING_NAME, NULL, NULL, FALSE },
+ { NM_SETTING_PPP_SETTING_NAME, NULL, NULL, FALSE },
{ NM_SETTING_IP4_CONFIG_SETTING_NAME, NULL, NULL, FALSE },
+ { NM_SETTING_IP6_CONFIG_SETTING_NAME, NULL, NULL, FALSE },
{ NULL, NULL, NULL, FALSE }
};
--
2.1.0

View File

@ -0,0 +1,48 @@
From 9736327b2616861dfec181e88f908a18b22d781c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ji=C5=99=C3=AD=20Klime=C5=A1?= <jklimes@redhat.com>
Date: Thu, 7 May 2015 11:27:26 +0200
Subject: [PATCH] wifi: fix a crash in on_bss_proxy_acquired() (rh #1266003)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
g_dbus_proxy_get_cached_property_names() function can return NULL.
Program received signal SIGSEGV, Segmentation fault.
on_bss_proxy_acquired (proxy=0x7fffe4003880 [GDBusProxy], result=0x895490, user_data=<optimized out>) at supplicant-manager/nm-supplicant-interface.c:159
159 while (*iter) {
(gdb) bt
#0 0x000000000048fac7 in on_bss_proxy_acquired (proxy=0x7fffe4003880 [GDBusProxy], result=0x895490, user_data=<optimized out>)
at supplicant-manager/nm-supplicant-interface.c:159
#1 0x0000003bf84728b7 in g_simple_async_result_complete (simple=0x895490 [GSimpleAsyncResult]) at gsimpleasyncresult.c:763
#2 0x0000003bf8472919 in complete_in_idle_cb (data=<optimized out>) at gsimpleasyncresult.c:775
#3 0x0000003bf5c497fb in g_main_context_dispatch (context=0x7d6420) at gmain.c:3111
#4 0x0000003bf5c497fb in g_main_context_dispatch (context=context@entry=0x7d6420) at gmain.c:3710
#5 0x0000003bf5c49b98 in g_main_context_iterate (context=0x7d6420, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at gmain.c:3781
#6 0x0000003bf5c49ec2 in g_main_loop_run (loop=0x7d64e0) at gmain.c:3975
#7 0x00000000004349d6 in main (argc=1, argv=0x7fffffffe598) at main.c:486
https://bugzilla.redhat.com/show_bug.cgi?id=1266003
(cherry picked from commit 33527341b1e35034a4f1736df4bc98f8ac8418ab)
Signed-off-by: Jiří Klimeš <jklimes@redhat.com>
---
src/supplicant-manager/nm-supplicant-interface.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/supplicant-manager/nm-supplicant-interface.c b/src/supplicant-manager/nm-supplicant-interface.c
index 66bab2e..08b850a 100644
--- a/src/supplicant-manager/nm-supplicant-interface.c
+++ b/src/supplicant-manager/nm-supplicant-interface.c
@@ -154,7 +154,7 @@ on_bss_proxy_acquired (GDBusProxy *proxy, GAsyncResult *result, gpointer user_da
g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}"));
iter = properties = g_dbus_proxy_get_cached_property_names (proxy);
- while (*iter) {
+ while (iter && *iter) {
GVariant *copy = g_dbus_proxy_get_cached_property (proxy, *iter);
g_variant_builder_add (&builder, "{sv}", *iter++, copy);
--
2.1.0

View File

@ -0,0 +1,57 @@
From 2a8c93e940c3fdc5bb710f9fd1ec037e51524ed9 Mon Sep 17 00:00:00 2001
From: Thomas Haller <thaller@redhat.com>
Date: Fri, 16 Oct 2015 11:52:30 +0200
Subject: [PATCH] platform: fix link-detection for s390 CTC-type devices
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Commit 02c6a9334335d3ef32c6cc8fafc6cea235c80ffc (rh#1212118)
introduced detection of CTC devices based on the driver name.
That was broken a while ago while refactoring.
Related: https://bugzilla.redhat.com/show_bug.cgi?id=1212118
https://bugzilla.redhat.com/show_bug.cgi?id=1272974
Fixes: ddaea22332907c05222cbec1e1b4365689fbda9f
(cherry picked from commit 8a6afe92c18dfefa91d057518be00b0127720fa5)
Signed-off-by: Jiří Klimeš <jklimes@redhat.com>
---
src/platform/nm-linux-platform.c | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/src/platform/nm-linux-platform.c b/src/platform/nm-linux-platform.c
index 94103c5..0eaa8cb 100644
--- a/src/platform/nm-linux-platform.c
+++ b/src/platform/nm-linux-platform.c
@@ -947,18 +947,18 @@ link_extract_type (NMPlatform *platform, struct rtnl_link *rtnllink, gboolean *c
gs_free char *anycast_mask = NULL;
gs_free char *devtype = NULL;
- if (arptype == 256) {
- /* Some s390 CTC-type devices report 256 for the encapsulation type
- * for some reason, but we need to call them Ethernet.
- */
- if (!g_strcmp0 (driver, "ctcm"))
- return NM_LINK_TYPE_ETHERNET;
- }
-
/* Fallback OVS detection for kernel <= 3.16 */
if (nmp_utils_ethtool_get_driver_info (ifname, &driver, NULL, NULL)) {
if (!g_strcmp0 (driver, "openvswitch"))
return NM_LINK_TYPE_OPENVSWITCH;
+
+ if (arptype == 256) {
+ /* Some s390 CTC-type devices report 256 for the encapsulation type
+ * for some reason, but we need to call them Ethernet.
+ */
+ if (!g_strcmp0 (driver, "ctcm"))
+ return NM_LINK_TYPE_ETHERNET;
+ }
}
sysfs_path = g_strdup_printf ("/sys/class/net/%s", ifname);
--
2.1.0