Skip to content
This repository has been archived by the owner on Aug 5, 2022. It is now read-only.

Commit

Permalink
proc: snmp6: Use correct type in memset
Browse files Browse the repository at this point in the history
[ Upstream commit 3500cd73dff48f28f4ba80c171c4c80034d40f76 ]

Reading /proc/net/snmp6 yields bogus values on 32 bit kernels.
Use "u64" instead of "unsigned long" in sizeof().

Fixes: 4a4857b ("proc: Reduce cache miss in snmp6_seq_show")
Signed-off-by: Christian Perle <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
Christian Perle authored and gregkh committed Jul 5, 2017
1 parent 78b24ab commit 0596867
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/ipv6/proc.c
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ static void snmp6_seq_show_item64(struct seq_file *seq, void __percpu *mib,
u64 buff64[SNMP_MIB_MAX];
int i;

memset(buff64, 0, sizeof(unsigned long) * SNMP_MIB_MAX);
memset(buff64, 0, sizeof(u64) * SNMP_MIB_MAX);

snmp_get_cpu_field64_batch(buff64, itemlist, mib, syncpoff);
for (i = 0; itemlist[i].name; i++)
Expand Down

0 comments on commit 0596867

Please sign in to comment.