From 2e740fe3084fd06d493ad6ed74526c76c83cd7c3 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Tue, 3 May 2011 10:38:32 -0500 Subject: [PATCH] core: fix up checks for s390 CTC device type (bgo #649025) The original check had incorrect logic; correct it. --- src/nm-udev-manager.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/nm-udev-manager.c b/src/nm-udev-manager.c index 0b0e6fb298..41a4e15b16 100644 --- a/src/nm-udev-manager.c +++ b/src/nm-udev-manager.c @@ -490,6 +490,7 @@ net_add (NMUdevManager *self, GUdevDevice *device) gint etype; const char *iface; const char *tmp; + gboolean is_ctc; g_return_if_fail (device != NULL); @@ -499,12 +500,14 @@ net_add (NMUdevManager *self, GUdevDevice *device) return; } + etype = g_udev_device_get_sysfs_attr_as_int (device, "type"); + is_ctc = (strncmp (iface, "ctc", 3) == 0) && (etype == 256); + /* Ignore devices that don't report Ethernet encapsulation, except for * s390 CTC-type devices that report 256 for some reason. * FIXME: use something other than interface name to detect CTC here. */ - etype = g_udev_device_get_sysfs_attr_as_int (device, "type"); - if ((etype != 1) && (!strncmp (iface, "ctc", 3) && (etype != 256))) { + if ((etype != 1) && (is_ctc == FALSE)) { nm_log_dbg (LOGD_HW, "ignoring interface with type %d", etype); return; }