aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6/proc.c
diff options
context:
space:
mode:
authorAlexey Dobriyan <adobriyan@gmail.com>2008-11-20 07:20:10 -0500
committerDavid S. Miller <davem@davemloft.net>2008-11-20 07:20:10 -0500
commit5ece6c2ddd6f7da9e95dc325c742c0f5afbcecbe (patch)
treecf8ebb119403f92df8a296002b9316c9fa38a8a6 /net/ipv6/proc.c
parenta849854fc7e200d5e5a437dec9c1d0e8b105e50f (diff)
net: fix tiny output corruption of /proc/net/snmp6
Because "name" is static, it can be occasionally be filled with somewhat garbage if two processes read /proc/net/snmp6. Also, remove useless casts and "-1" -- snprintf() correctly terminates it's output. Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6/proc.c')
-rw-r--r--net/ipv6/proc.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/net/ipv6/proc.c b/net/ipv6/proc.c
index 07f0b76e7427..97c17fdd6f75 100644
--- a/net/ipv6/proc.c
+++ b/net/ipv6/proc.c
@@ -132,7 +132,7 @@ static struct snmp_mib snmp6_udplite6_list[] = {
132 132
133static void snmp6_seq_show_icmpv6msg(struct seq_file *seq, void **mib) 133static void snmp6_seq_show_icmpv6msg(struct seq_file *seq, void **mib)
134{ 134{
135 static char name[32]; 135 char name[32];
136 int i; 136 int i;
137 137
138 /* print by name -- deprecated items */ 138 /* print by name -- deprecated items */
@@ -144,7 +144,7 @@ static void snmp6_seq_show_icmpv6msg(struct seq_file *seq, void **mib)
144 p = icmp6type2name[icmptype]; 144 p = icmp6type2name[icmptype];
145 if (!p) /* don't print un-named types here */ 145 if (!p) /* don't print un-named types here */
146 continue; 146 continue;
147 (void) snprintf(name, sizeof(name)-1, "Icmp6%s%s", 147 snprintf(name, sizeof(name), "Icmp6%s%s",
148 i & 0x100 ? "Out" : "In", p); 148 i & 0x100 ? "Out" : "In", p);
149 seq_printf(seq, "%-32s\t%lu\n", name, 149 seq_printf(seq, "%-32s\t%lu\n", name,
150 snmp_fold_field(mib, i)); 150 snmp_fold_field(mib, i));
@@ -157,7 +157,7 @@ static void snmp6_seq_show_icmpv6msg(struct seq_file *seq, void **mib)
157 val = snmp_fold_field(mib, i); 157 val = snmp_fold_field(mib, i);
158 if (!val) 158 if (!val)
159 continue; 159 continue;
160 (void) snprintf(name, sizeof(name)-1, "Icmp6%sType%u", 160 snprintf(name, sizeof(name), "Icmp6%sType%u",
161 i & 0x100 ? "Out" : "In", i & 0xff); 161 i & 0x100 ? "Out" : "In", i & 0xff);
162 seq_printf(seq, "%-32s\t%lu\n", name, val); 162 seq_printf(seq, "%-32s\t%lu\n", name, val);
163 } 163 }