Commit e304e21a2b701285a71970f8ba3f967ed4d0bbcb
Committed by
David S. Miller
1 parent
bd7d4c1281
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>
Showing 1 changed file with 7 additions and 4 deletions Side-by-side Diff
net/sched/cls_flower.c
... | ... | @@ -856,14 +856,16 @@ |
856 | 856 | } |
857 | 857 | } |
858 | 858 | |
859 | -static int fl_set_key_flags(struct nlattr **tb, | |
860 | - u32 *flags_key, u32 *flags_mask) | |
859 | +static int fl_set_key_flags(struct nlattr **tb, u32 *flags_key, | |
860 | + u32 *flags_mask, struct netlink_ext_ack *extack) | |
861 | 861 | { |
862 | 862 | u32 key, mask; |
863 | 863 | |
864 | 864 | /* mask is mandatory for flags */ |
865 | - if (!tb[TCA_FLOWER_KEY_FLAGS_MASK]) | |
865 | + if (!tb[TCA_FLOWER_KEY_FLAGS_MASK]) { | |
866 | + NL_SET_ERR_MSG(extack, "Missing flags mask"); | |
866 | 867 | return -EINVAL; |
868 | + } | |
867 | 869 | |
868 | 870 | key = be32_to_cpu(nla_get_u32(tb[TCA_FLOWER_KEY_FLAGS])); |
869 | 871 | mask = be32_to_cpu(nla_get_u32(tb[TCA_FLOWER_KEY_FLAGS_MASK])); |
... | ... | @@ -1474,7 +1476,8 @@ |
1474 | 1476 | return ret; |
1475 | 1477 | |
1476 | 1478 | if (tb[TCA_FLOWER_KEY_FLAGS]) |
1477 | - ret = fl_set_key_flags(tb, &key->control.flags, &mask->control.flags); | |
1479 | + ret = fl_set_key_flags(tb, &key->control.flags, | |
1480 | + &mask->control.flags, extack); | |
1478 | 1481 | |
1479 | 1482 | return ret; |
1480 | 1483 | } |