summaryrefslogtreecommitdiff
path: root/net/sched
diff options
context:
space:
mode:
authorGuillaume Nault <gnault@redhat.com>2020-03-23 23:48:53 +0300
committerDavid S. Miller <davem@davemloft.net>2020-03-27 05:52:31 +0300
commite304e21a2b701285a71970f8ba3f967ed4d0bbcb (patch)
tree659a11744f4cbe21f69920f890780188334ef80c /net/sched
parentbd7d4c12819b60b161939bc2f43053955d24d0df (diff)
downloadlinux-e304e21a2b701285a71970f8ba3f967ed4d0bbcb.tar.xz
cls_flower: Add extack support for flags key
Pass extack down to fl_set_key_flags() and set message on error. Signed-off-by: Guillaume Nault <gnault@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sched')
-rw-r--r--net/sched/cls_flower.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/net/sched/cls_flower.c b/net/sched/cls_flower.c
index 5811dd971ee5..9b6acd736dc8 100644
--- a/net/sched/cls_flower.c
+++ b/net/sched/cls_flower.c
@@ -856,14 +856,16 @@ static void fl_set_key_flag(u32 flower_key, u32 flower_mask,
}
}
-static int fl_set_key_flags(struct nlattr **tb,
- u32 *flags_key, u32 *flags_mask)
+static int fl_set_key_flags(struct nlattr **tb, u32 *flags_key,
+ u32 *flags_mask, struct netlink_ext_ack *extack)
{
u32 key, mask;
/* mask is mandatory for flags */
- if (!tb[TCA_FLOWER_KEY_FLAGS_MASK])
+ if (!tb[TCA_FLOWER_KEY_FLAGS_MASK]) {
+ NL_SET_ERR_MSG(extack, "Missing flags mask");
return -EINVAL;
+ }
key = be32_to_cpu(nla_get_u32(tb[TCA_FLOWER_KEY_FLAGS]));
mask = be32_to_cpu(nla_get_u32(tb[TCA_FLOWER_KEY_FLAGS_MASK]));
@@ -1474,7 +1476,8 @@ static int fl_set_key(struct net *net, struct nlattr **tb,
return ret;
if (tb[TCA_FLOWER_KEY_FLAGS])
- ret = fl_set_key_flags(tb, &key->control.flags, &mask->control.flags);
+ ret = fl_set_key_flags(tb, &key->control.flags,
+ &mask->control.flags, extack);
return ret;
}