summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2020-02-20 12:32:26 +0100
committerThomas Haller <thaller@redhat.com>2020-02-20 12:44:29 +0100
commit1d66e7b87a84106999019b390bfe88a13abc0ff8 (patch)
treedfc1ffb7c6d6befa25abee87d80ce4056a2c487c
parentcb33946d73fa8d61cf2a103b727bdc86aac71b09 (diff)
downloadNetworkManager-th/platform-link-type-metadata.tar.gz
platform: use nm_streq() instead of strcmp()th/platform-link-type-metadata
-rw-r--r--src/platform/nm-linux-platform.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/platform/nm-linux-platform.c b/src/platform/nm-linux-platform.c
index 8952b869ab..c744be88d4 100644
--- a/src/platform/nm-linux-platform.c
+++ b/src/platform/nm-linux-platform.c
@@ -1042,7 +1042,7 @@ _linktype_get_type (NMPlatform *platform,
obj = _lookup_cached_link (cache, ifindex, completed_from_cache, link_cached);
/* If we detected the link type before, we stick to that
- * decision unless the "kind" no "name" changed. If "name" changed,
+ * decision unless the "kind" or "name" changed. If "name" changed,
* it means that their type may not have been determined correctly
* due to race conditions while accessing sysfs.
*
@@ -1157,13 +1157,14 @@ _linktype_get_type (NMPlatform *platform,
*/
if (!kind && !devtype)
return NM_LINK_TYPE_ETHERNET;
+
/* The USB gadget interfaces behave and look like ordinary ethernet devices
* aside from the DEVTYPE. */
- if (!g_strcmp0 (devtype, "gadget"))
+ if (nm_streq0 (devtype, "gadget"))
return NM_LINK_TYPE_ETHERNET;
/* Distributed Switch Architecture switch chips */
- if (!g_strcmp0 (devtype, "dsa"))
+ if (nm_streq0 (devtype, "dsa"))
return NM_LINK_TYPE_ETHERNET;
}
}
@@ -4653,7 +4654,7 @@ _nl_msg_new_qdisc (int nlmsg_type,
if (!(tc_options = nla_nest_start (msg, TCA_OPTIONS)))
goto nla_put_failure;
- if (strcmp (qdisc->kind, "fq_codel") == 0) {
+ if (nm_streq (qdisc->kind, "fq_codel")) {
if (qdisc->fq_codel.limit)
NLA_PUT_U32 (msg, TCA_FQ_CODEL_LIMIT, qdisc->fq_codel.limit);
if (qdisc->fq_codel.flows)