naccyde / rpms / iproute

Forked from rpms/iproute 8 months ago
Clone

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

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