It is a common idiom in all *_nlmsg_parse() functions, but
nftnl_gen_nlmsg_parse() doesn't make use of the data pointer and the
compiler probably can't eliminate it since there could be a side-effect.
Signed-off-by: Phil Sutter <phil@nwl.cc>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
int nftnl_gen_nlmsg_parse(const struct nlmsghdr *nlh, struct nftnl_gen *gen)
{
struct nlattr *tb[NFTA_GEN_MAX + 1] = {};
- struct nfgenmsg *nfg = mnl_nlmsg_get_payload(nlh);
- if (mnl_attr_parse(nlh, sizeof(*nfg), nftnl_gen_parse_attr_cb, tb) < 0)
+ if (mnl_attr_parse(nlh, sizeof(struct nfgenmsg),
+ nftnl_gen_parse_attr_cb, tb) < 0)
return -1;
if (tb[NFTA_GEN_ID]) {