platform: fix link-detection for s390 CTC-type devices

Commit 02c6a93343 (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: ddaea22332
This commit is contained in:
Thomas Haller
2015-10-16 11:52:30 +02:00
parent 571f0dba38
commit 8a6afe92c1

View File

@@ -945,6 +945,11 @@ link_extract_type (NMPlatform *platform, struct rtnl_link *rtnllink, gboolean *c
gs_free char *anycast_mask = NULL;
gs_free char *devtype = NULL;
/* 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.
@@ -952,11 +957,6 @@ link_extract_type (NMPlatform *platform, struct rtnl_link *rtnllink, gboolean *c
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;
}
sysfs_path = g_strdup_printf ("/sys/class/net/%s", ifname);