aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6/proc.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/ipv6/proc.c')
-rw-r--r--net/ipv6/proc.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/net/ipv6/proc.c b/net/ipv6/proc.c
index efee7a6301a8..35249d8487bb 100644
--- a/net/ipv6/proc.c
+++ b/net/ipv6/proc.c
@@ -49,6 +49,8 @@ static int sockstat6_seq_show(struct seq_file *seq, void *v)
49 fold_prot_inuse(&tcpv6_prot)); 49 fold_prot_inuse(&tcpv6_prot));
50 seq_printf(seq, "UDP6: inuse %d\n", 50 seq_printf(seq, "UDP6: inuse %d\n",
51 fold_prot_inuse(&udpv6_prot)); 51 fold_prot_inuse(&udpv6_prot));
52 seq_printf(seq, "UDPLITE6: inuse %d\n",
53 fold_prot_inuse(&udplitev6_prot));
52 seq_printf(seq, "RAW6: inuse %d\n", 54 seq_printf(seq, "RAW6: inuse %d\n",
53 fold_prot_inuse(&rawv6_prot)); 55 fold_prot_inuse(&rawv6_prot));
54 seq_printf(seq, "FRAG6: inuse %d memory %d\n", 56 seq_printf(seq, "FRAG6: inuse %d memory %d\n",
@@ -133,6 +135,14 @@ static struct snmp_mib snmp6_udp6_list[] = {
133 SNMP_MIB_SENTINEL 135 SNMP_MIB_SENTINEL
134}; 136};
135 137
138static struct snmp_mib snmp6_udplite6_list[] = {
139 SNMP_MIB_ITEM("UdpLite6InDatagrams", UDP_MIB_INDATAGRAMS),
140 SNMP_MIB_ITEM("UdpLite6NoPorts", UDP_MIB_NOPORTS),
141 SNMP_MIB_ITEM("UdpLite6InErrors", UDP_MIB_INERRORS),
142 SNMP_MIB_ITEM("UdpLite6OutDatagrams", UDP_MIB_OUTDATAGRAMS),
143 SNMP_MIB_SENTINEL
144};
145
136static unsigned long 146static unsigned long
137fold_field(void *mib[], int offt) 147fold_field(void *mib[], int offt)
138{ 148{
@@ -161,11 +171,13 @@ static int snmp6_seq_show(struct seq_file *seq, void *v)
161 171
162 if (idev) { 172 if (idev) {
163 seq_printf(seq, "%-32s\t%u\n", "ifIndex", idev->dev->ifindex); 173 seq_printf(seq, "%-32s\t%u\n", "ifIndex", idev->dev->ifindex);
174 snmp6_seq_show_item(seq, (void **)idev->stats.ipv6, snmp6_ipstats_list);
164 snmp6_seq_show_item(seq, (void **)idev->stats.icmpv6, snmp6_icmp6_list); 175 snmp6_seq_show_item(seq, (void **)idev->stats.icmpv6, snmp6_icmp6_list);
165 } else { 176 } else {
166 snmp6_seq_show_item(seq, (void **)ipv6_statistics, snmp6_ipstats_list); 177 snmp6_seq_show_item(seq, (void **)ipv6_statistics, snmp6_ipstats_list);
167 snmp6_seq_show_item(seq, (void **)icmpv6_statistics, snmp6_icmp6_list); 178 snmp6_seq_show_item(seq, (void **)icmpv6_statistics, snmp6_icmp6_list);
168 snmp6_seq_show_item(seq, (void **)udp_stats_in6, snmp6_udp6_list); 179 snmp6_seq_show_item(seq, (void **)udp_stats_in6, snmp6_udp6_list);
180 snmp6_seq_show_item(seq, (void **)udplite_stats_in6, snmp6_udplite6_list);
169 } 181 }
170 return 0; 182 return 0;
171} 183}
@@ -281,6 +293,9 @@ int snmp6_alloc_dev(struct inet6_dev *idev)
281 if (!idev || !idev->dev) 293 if (!idev || !idev->dev)
282 return -EINVAL; 294 return -EINVAL;
283 295
296 if (snmp6_mib_init((void **)idev->stats.ipv6, sizeof(struct ipstats_mib),
297 __alignof__(struct ipstats_mib)) < 0)
298 goto err_ip;
284 if (snmp6_mib_init((void **)idev->stats.icmpv6, sizeof(struct icmpv6_mib), 299 if (snmp6_mib_init((void **)idev->stats.icmpv6, sizeof(struct icmpv6_mib),
285 __alignof__(struct icmpv6_mib)) < 0) 300 __alignof__(struct icmpv6_mib)) < 0)
286 goto err_icmp; 301 goto err_icmp;
@@ -288,12 +303,15 @@ int snmp6_alloc_dev(struct inet6_dev *idev)
288 return 0; 303 return 0;
289 304
290err_icmp: 305err_icmp:
306 snmp6_mib_free((void **)idev->stats.ipv6);
307err_ip:
291 return err; 308 return err;
292} 309}
293 310
294int snmp6_free_dev(struct inet6_dev *idev) 311int snmp6_free_dev(struct inet6_dev *idev)
295{ 312{
296 snmp6_mib_free((void **)idev->stats.icmpv6); 313 snmp6_mib_free((void **)idev->stats.icmpv6);
314 snmp6_mib_free((void **)idev->stats.ipv6);
297 return 0; 315 return 0;
298} 316}
299 317