naccyde / rpms / iproute

Forked from rpms/iproute 7 months ago
Clone

Blame SOURCES/0034-tipc-Drop-unused-variable-genl.patch

930fb9
From 03b579ec713d0a1062b16d0eab64d3189f6e325a Mon Sep 17 00:00:00 2001
930fb9
From: Phil Sutter <psutter@redhat.com>
930fb9
Date: Thu, 25 Oct 2018 12:24:30 +0200
930fb9
Subject: [PATCH] tipc: Drop unused variable 'genl'
930fb9
930fb9
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1602555
930fb9
Upstream Status: iproute2.git commit 8d05f33a381a2
930fb9
930fb9
commit 8d05f33a381a22572341204c667aafca02aabcca
930fb9
Author: Phil Sutter <phil@nwl.cc>
930fb9
Date:   Thu Oct 18 15:48:09 2018 +0200
930fb9
930fb9
    tipc: Drop unused variable 'genl'
930fb9
930fb9
    Although initialized by call to libmnl, the variable is used only in a
930fb9
    call to sizeof(). Drop it and call sizeof with its type instead.
930fb9
930fb9
    Fixes: f043759dd4928 ("tipc: add new TIPC configuration tool")
930fb9
    Signed-off-by: Phil Sutter <phil@nwl.cc>
930fb9
    Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
930fb9
---
930fb9
 tipc/node.c | 9 +++------
930fb9
 1 file changed, 3 insertions(+), 6 deletions(-)
930fb9
930fb9
diff --git a/tipc/node.c b/tipc/node.c
930fb9
index 0fa1064..2fec675 100644
930fb9
--- a/tipc/node.c
930fb9
+++ b/tipc/node.c
930fb9
@@ -26,13 +26,12 @@
930fb9
 
930fb9
 static int node_list_cb(const struct nlmsghdr *nlh, void *data)
930fb9
 {
930fb9
-	struct genlmsghdr *genl = mnl_nlmsg_get_payload(nlh);
930fb9
 	struct nlattr *info[TIPC_NLA_MAX + 1] = {};
930fb9
 	struct nlattr *attrs[TIPC_NLA_NODE_MAX + 1] = {};
930fb9
 	char str[33] = {};
930fb9
 	uint32_t addr;
930fb9
 
930fb9
-	mnl_attr_parse(nlh, sizeof(*genl), parse_attrs, info);
930fb9
+	mnl_attr_parse(nlh, sizeof(struct genlmsghdr), parse_attrs, info);
930fb9
 	if (!info[TIPC_NLA_NODE])
930fb9
 		return MNL_CB_ERROR;
930fb9
 
930fb9
@@ -160,7 +159,6 @@ static int cmd_node_set_nodeid(struct nlmsghdr *nlh, const struct cmd *cmd,
930fb9
 
930fb9
 static int nodeid_get_cb(const struct nlmsghdr *nlh, void *data)
930fb9
 {
930fb9
-	struct genlmsghdr *genl = mnl_nlmsg_get_payload(nlh);
930fb9
 	struct nlattr *info[TIPC_NLA_MAX + 1] = {};
930fb9
 	struct nlattr *attrs[TIPC_NLA_NET_MAX + 1] = {};
930fb9
 	char str[33] = {0,};
930fb9
@@ -168,7 +166,7 @@ static int nodeid_get_cb(const struct nlmsghdr *nlh, void *data)
930fb9
 	uint64_t *w0 = (uint64_t *) &id[0];
930fb9
 	uint64_t *w1 = (uint64_t *) &id[8];
930fb9
 
930fb9
-	mnl_attr_parse(nlh, sizeof(*genl), parse_attrs, info);
930fb9
+	mnl_attr_parse(nlh, sizeof(struct genlmsghdr), parse_attrs, info);
930fb9
 	if (!info[TIPC_NLA_NET])
930fb9
 		return MNL_CB_ERROR;
930fb9
 
930fb9
@@ -207,11 +205,10 @@ static int cmd_node_get_nodeid(struct nlmsghdr *nlh, const struct cmd *cmd,
930fb9
 
930fb9
 static int netid_get_cb(const struct nlmsghdr *nlh, void *data)
930fb9
 {
930fb9
-	struct genlmsghdr *genl = mnl_nlmsg_get_payload(nlh);
930fb9
 	struct nlattr *info[TIPC_NLA_MAX + 1] = {};
930fb9
 	struct nlattr *attrs[TIPC_NLA_NET_MAX + 1] = {};
930fb9
 
930fb9
-	mnl_attr_parse(nlh, sizeof(*genl), parse_attrs, info);
930fb9
+	mnl_attr_parse(nlh, sizeof(struct genlmsghdr), parse_attrs, info);
930fb9
 	if (!info[TIPC_NLA_NET])
930fb9
 		return MNL_CB_ERROR;
930fb9
 
930fb9
-- 
930fb9
1.8.3.1
930fb9