Skip to content

Commit

Permalink
net sched actions: fix module auto-loading
Browse files Browse the repository at this point in the history
Macro __stringify_1() can stringify a macro argument, however IFE_META_*
are enums, so they never expand, however request_module expects an integer
in IFE module name, so as a result it always fails to auto-load.

Fixes: ef6980b ("introduce IFE action")
Signed-off-by: Roman Mashak <mrv@mojatatu.com>
Acked-by: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Roman Mashak authored and David S. Miller committed Oct 13, 2017
1 parent 8f04748 commit d3f24ba
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion net/sched/act_ife.c
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,20 @@ static int ife_validate_metatype(struct tcf_meta_ops *ops, void *val, int len)
return ret;
}

static const char *ife_meta_id2name(u32 metaid)
{
switch (metaid) {
case IFE_META_SKBMARK:
return "skbmark";
case IFE_META_PRIO:
return "skbprio";
case IFE_META_TCINDEX:
return "tcindex";
default:
return "unknown";
}
}

/* called when adding new meta information
* under ife->tcf_lock for existing action
*/
Expand All @@ -263,7 +277,7 @@ static int load_metaops_and_vet(struct tcf_ife_info *ife, u32 metaid,
if (exists)
spin_unlock_bh(&ife->tcf_lock);
rtnl_unlock();
request_module("ife-meta-%u", metaid);
request_module("ife-meta-%s", ife_meta_id2name(metaid));
rtnl_lock();
if (exists)
spin_lock_bh(&ife->tcf_lock);
Expand Down

0 comments on commit d3f24ba

Please sign in to comment.