Skip to content

Commit

Permalink
netfilter: nf_tables: Drop pointless memset when dumping rules
Browse files Browse the repository at this point in the history
None of the dump callbacks uses netlink_callback::args beyond the first
element, no need to zero the data.

Fixes: 9651851 ("netfilter: add nftables")
Signed-off-by: Phil Sutter <phil@nwl.cc>
Signed-off-by: Florian Westphal <fw@strlen.de>
  • Loading branch information
Phil Sutter authored and Florian Westphal committed Oct 10, 2023
1 parent afed2b5 commit 30fa41a
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions net/netfilter/nf_tables_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -3465,10 +3465,6 @@ static int __nf_tables_dump_rules(struct sk_buff *skb,
goto cont_skip;
if (*idx < s_idx)
goto cont;
if (*idx > s_idx) {
memset(&cb->args[1], 0,
sizeof(cb->args) - sizeof(cb->args[0]));
}
if (prule)
handle = prule->handle;
else
Expand Down

0 comments on commit 30fa41a

Please sign in to comment.