net_sched: reject unknown tcfa_action values
authorPaolo Abeni <pabeni@redhat.com>
Wed, 29 Aug 2018 08:22:33 +0000 (10:22 +0200)
committerDavid S. Miller <davem@davemloft.net>
Thu, 30 Aug 2018 05:10:59 +0000 (22:10 -0700)
commit97763dc0f4010bc20e2969a6bf9a40a2551c4f79
treeeb49c6777a411787afb9947a29ddd30aae39c111
parentc4053ef322081554765e1b708d6cdd8855e1d72d
net_sched: reject unknown tcfa_action values

After the commit 802bfb19152c ("net/sched: user-space can't set
unknown tcfa_action values"), unknown tcfa_action values are
converted to TC_ACT_UNSPEC, but the common agreement is instead
rejecting such configurations.

This change also introduces a helper to simplify the destruction
of a single action, avoiding code duplication.

v1 -> v2:
 - helper is now static and renamed according to act_* convention
 - updated extack message, according to the new behavior

Fixes: 802bfb19152c ("net/sched: user-space can't set unknown tcfa_action values")
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Acked-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/sched/act_api.c