Skip to content

Commit e304e21

Browse files
Guillaume Naultdavem330
authored andcommitted
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 <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent bd7d4c1 commit e304e21

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

net/sched/cls_flower.c

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -856,14 +856,16 @@ static void fl_set_key_flag(u32 flower_key, u32 flower_mask,
856856
}
857857
}
858858

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)
861861
{
862862
u32 key, mask;
863863

864864
/* 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");
866867
return -EINVAL;
868+
}
867869

868870
key = be32_to_cpu(nla_get_u32(tb[TCA_FLOWER_KEY_FLAGS]));
869871
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,
14741476
return ret;
14751477

14761478
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);
14781481

14791482
return ret;
14801483
}

0 commit comments

Comments
 (0)