return err;
}
+static const struct nla_policy em_policy[TCA_EMATCH_TREE_MAX + 1] = {
+ [TCA_EMATCH_TREE_HDR] = { .len = sizeof(struct tcf_ematch_tree_hdr) },
+ [TCA_EMATCH_TREE_LIST] = { .type = NLA_NESTED },
+};
+
/**
* tcf_em_tree_validate - validate ematch config TLV and build ematch tree
*
return 0;
}
- err = nla_parse_nested(tb, TCA_EMATCH_TREE_MAX, nla, NULL);
+ err = nla_parse_nested(tb, TCA_EMATCH_TREE_MAX, nla, em_policy);
if (err < 0)
goto errout;
if (rt_hdr == NULL || rt_list == NULL)
goto errout;
- if (nla_len(rt_hdr) < sizeof(*tree_hdr) ||
- nla_len(rt_list) < sizeof(*rt_match))
- goto errout;
-
tree_hdr = nla_data(rt_hdr);
memcpy(&tree->hdr, tree_hdr, sizeof(*tree_hdr));