diff --git a/lib/attr.c b/lib/attr.c index 2c03fa1..90070df 100644 --- a/lib/attr.c +++ b/lib/attr.c @@ -182,6 +182,7 @@ static uint16_t nla_attr_minlen[NLA_TYPE_MAX+1] = { [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, @@ -204,9 +205,6 @@ 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;