Blame SOURCES/0031-rh1272974-detect-s390-ctc-device.path

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