Although wasteful, NLA_FLAG with non zero payload cause no harm
and should thus not be rejected.
Signed-off-by: Thomas Graf <tgraf@suug.ch>
[NLA_U32] = sizeof(uint32_t),
[NLA_U64] = sizeof(uint64_t),
[NLA_STRING] = 1,
+ [NLA_FLAG] = 0,
};
static int validate_nla(struct nlattr *nla, int maxtype,
else if (pt->type != NLA_UNSPEC)
minlen = nla_attr_minlen[pt->type];
- if (pt->type == NLA_FLAG && nla_len(nla) > 0)
- return -NLE_RANGE;
-
if (nla_len(nla) < minlen)
return -NLE_RANGE;