platform: fix TC to-string/hash/cmp functions to include the action

Also add a define NM_PLATFORM_ACTION_KIND_SIMPLE. It makes the
uses of "simple" grepable.
This commit is contained in:
Thomas Haller
2017-12-10 12:52:41 +01:00
committed by Lubomir Rintel
parent b0fd3ecbaf
commit fe3d7209e7
3 changed files with 40 additions and 3 deletions

View File

@@ -2962,12 +2962,14 @@ _add_action (struct nl_msg *msg,
{
struct nlattr *prio;
nm_assert (action || action->kind);
if (!(prio = nla_nest_start (msg, 1 /* priority */)))
goto nla_put_failure;
NLA_PUT_STRING (msg, TCA_ACT_KIND, action->kind);
if (strcmp (action->kind, "simple") == 0)
if (nm_streq (action->kind, NM_PLATFORM_ACTION_KIND_SIMPLE))
_add_action_simple (msg, &action->simple);
nla_nest_end (msg, prio);