Blame SOURCES/0002-gen-Remove-a-pointless-call-to-mnl_nlmsg_get_payload.patch

589a38
From c837a18ced48cac1ac221e8213a6851c6636476e Mon Sep 17 00:00:00 2001
589a38
From: Phil Sutter <psutter@redhat.com>
589a38
Date: Mon, 22 Jul 2019 17:34:25 +0200
589a38
Subject: [PATCH] gen: Remove a pointless call to mnl_nlmsg_get_payload()
589a38
589a38
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1510538
589a38
Upstream Status: libnftnl commit fd9ab5c922cd8
589a38
589a38
commit fd9ab5c922cd8d15e8f0251c70bcd9532158e9b0
589a38
Author: Phil Sutter <phil@nwl.cc>
589a38
Date:   Thu Dec 14 20:40:21 2017 +0100
589a38
589a38
    gen: Remove a pointless call to mnl_nlmsg_get_payload()
589a38
589a38
    It is a common idiom in all *_nlmsg_parse() functions, but
589a38
    nftnl_gen_nlmsg_parse() doesn't make use of the data pointer and the
589a38
    compiler probably can't eliminate it since there could be a side-effect.
589a38
589a38
    Signed-off-by: Phil Sutter <phil@nwl.cc>
589a38
    Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
589a38
---
589a38
 src/gen.c | 4 ++--
589a38
 1 file changed, 2 insertions(+), 2 deletions(-)
589a38
589a38
diff --git a/src/gen.c b/src/gen.c
589a38
index 58b3a96..eafb015 100644
589a38
--- a/src/gen.c
589a38
+++ b/src/gen.c
589a38
@@ -143,9 +143,9 @@ static int nftnl_gen_parse_attr_cb(const struct nlattr *attr, void *data)
589a38
 int nftnl_gen_nlmsg_parse(const struct nlmsghdr *nlh, struct nftnl_gen *gen)
589a38
 {
589a38
 	struct nlattr *tb[NFTA_GEN_MAX + 1] = {};
589a38
-	struct nfgenmsg *nfg = mnl_nlmsg_get_payload(nlh);
589a38
 
589a38
-	if (mnl_attr_parse(nlh, sizeof(*nfg), nftnl_gen_parse_attr_cb, tb) < 0)
589a38
+	if (mnl_attr_parse(nlh, sizeof(struct nfgenmsg),
589a38
+			   nftnl_gen_parse_attr_cb, tb) < 0)
589a38
 		return -1;
589a38
 
589a38
 	if (tb[NFTA_GEN_ID]) {
589a38
-- 
589a38
1.8.3.1
589a38