The second mnl_attr_parse() call re-parses the very same message into
the same array as the call at the top of the function, and none of the
code in between touches the table or the values extracted from it:
all attribute reads happen before it and attr_cb() just rewrites the
table entries with identical pointers.
Remove the redundant call; its failure semantics were identical to the
first parse anyway (MNL_CB_OK when silent, MNL_CB_ERROR otherwise).
Signed-off-by: Prabhakar Pujeri <redacted>
---
netlink/rss.c | 4 ----
1 file changed, 4 deletions(-)
diff --git a/netlink/rss.c b/netlink/rss.c
index 85c2bd9..8c70c29 100644
--- a/netlink/rss.c
+++ b/netlink/rss.c
@@ -149,10 +149,6 @@ int rss_reply_cb(const struct nlmsghdr *nlhdr, void *data)
hash_funcs = global_stringset(ETH_SS_RSS_HASH_FUNCS,
nlctx->ethnl2_socket);
- ret = mnl_attr_parse(nlhdr, GENL_HDRLEN, attr_cb, &tb_info);
- if (ret < 0)
- return silent ? MNL_CB_OK : MNL_CB_ERROR;
-
ret = get_num_rings(args);
if (ret < 0)
return MNL_CB_ERROR;
--
2.55.0