aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/net/ip.h2
-rw-r--r--net/ipv4/af_inet.c23
-rw-r--r--net/ipv6/addrconf.c9
-rw-r--r--net/ipv6/af_inet6.c17
4 files changed, 20 insertions, 31 deletions
diff --git a/include/net/ip.h b/include/net/ip.h
index 17d1189723fc..571bcf2a1cff 100644
--- a/include/net/ip.h
+++ b/include/net/ip.h
@@ -171,7 +171,7 @@ DECLARE_SNMP_STAT(struct linux_mib, net_statistics);
171#define NET_ADD_STATS_USER(field, adnd) SNMP_ADD_STATS_USER(net_statistics, field, adnd) 171#define NET_ADD_STATS_USER(field, adnd) SNMP_ADD_STATS_USER(net_statistics, field, adnd)
172 172
173extern unsigned long snmp_fold_field(void *mib[], int offt); 173extern unsigned long snmp_fold_field(void *mib[], int offt);
174extern int snmp_mib_init(void *ptr[2], size_t mibsize, size_t mibalign); 174extern int snmp_mib_init(void *ptr[2], size_t mibsize);
175extern void snmp_mib_free(void *ptr[2]); 175extern void snmp_mib_free(void *ptr[2]);
176 176
177extern void inet_get_local_port_range(int *low, int *high); 177extern void inet_get_local_port_range(int *low, int *high);
diff --git a/net/ipv4/af_inet.c b/net/ipv4/af_inet.c
index 0e4b6eba2340..7f8b27ff94ff 100644
--- a/net/ipv4/af_inet.c
+++ b/net/ipv4/af_inet.c
@@ -1242,7 +1242,7 @@ unsigned long snmp_fold_field(void *mib[], int offt)
1242} 1242}
1243EXPORT_SYMBOL_GPL(snmp_fold_field); 1243EXPORT_SYMBOL_GPL(snmp_fold_field);
1244 1244
1245int snmp_mib_init(void *ptr[2], size_t mibsize, size_t mibalign) 1245int snmp_mib_init(void *ptr[2], size_t mibsize)
1246{ 1246{
1247 BUG_ON(ptr == NULL); 1247 BUG_ON(ptr == NULL);
1248 ptr[0] = __alloc_percpu(mibsize); 1248 ptr[0] = __alloc_percpu(mibsize);
@@ -1296,32 +1296,25 @@ static struct net_protocol icmp_protocol = {
1296static int __init init_ipv4_mibs(void) 1296static int __init init_ipv4_mibs(void)
1297{ 1297{
1298 if (snmp_mib_init((void **)net_statistics, 1298 if (snmp_mib_init((void **)net_statistics,
1299 sizeof(struct linux_mib), 1299 sizeof(struct linux_mib)) < 0)
1300 __alignof__(struct linux_mib)) < 0)
1301 goto err_net_mib; 1300 goto err_net_mib;
1302 if (snmp_mib_init((void **)ip_statistics, 1301 if (snmp_mib_init((void **)ip_statistics,
1303 sizeof(struct ipstats_mib), 1302 sizeof(struct ipstats_mib)) < 0)
1304 __alignof__(struct ipstats_mib)) < 0)
1305 goto err_ip_mib; 1303 goto err_ip_mib;
1306 if (snmp_mib_init((void **)icmp_statistics, 1304 if (snmp_mib_init((void **)icmp_statistics,
1307 sizeof(struct icmp_mib), 1305 sizeof(struct icmp_mib)) < 0)
1308 __alignof__(struct icmp_mib)) < 0)
1309 goto err_icmp_mib; 1306 goto err_icmp_mib;
1310 if (snmp_mib_init((void **)icmpmsg_statistics, 1307 if (snmp_mib_init((void **)icmpmsg_statistics,
1311 sizeof(struct icmpmsg_mib), 1308 sizeof(struct icmpmsg_mib)) < 0)
1312 __alignof__(struct icmpmsg_mib)) < 0)
1313 goto err_icmpmsg_mib; 1309 goto err_icmpmsg_mib;
1314 if (snmp_mib_init((void **)tcp_statistics, 1310 if (snmp_mib_init((void **)tcp_statistics,
1315 sizeof(struct tcp_mib), 1311 sizeof(struct tcp_mib)) < 0)
1316 __alignof__(struct tcp_mib)) < 0)
1317 goto err_tcp_mib; 1312 goto err_tcp_mib;
1318 if (snmp_mib_init((void **)udp_statistics, 1313 if (snmp_mib_init((void **)udp_statistics,
1319 sizeof(struct udp_mib), 1314 sizeof(struct udp_mib)) < 0)
1320 __alignof__(struct udp_mib)) < 0)
1321 goto err_udp_mib; 1315 goto err_udp_mib;
1322 if (snmp_mib_init((void **)udplite_statistics, 1316 if (snmp_mib_init((void **)udplite_statistics,
1323 sizeof(struct udp_mib), 1317 sizeof(struct udp_mib)) < 0)
1324 __alignof__(struct udp_mib)) < 0)
1325 goto err_udplite_mib; 1318 goto err_udplite_mib;
1326 1319
1327 tcp_mib_init(); 1320 tcp_mib_init();
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
index 95cf3aa41c98..ba6f7925c178 100644
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -256,16 +256,13 @@ static void addrconf_mod_timer(struct inet6_ifaddr *ifp,
256static int snmp6_alloc_dev(struct inet6_dev *idev) 256static int snmp6_alloc_dev(struct inet6_dev *idev)
257{ 257{
258 if (snmp_mib_init((void **)idev->stats.ipv6, 258 if (snmp_mib_init((void **)idev->stats.ipv6,
259 sizeof(struct ipstats_mib), 259 sizeof(struct ipstats_mib)) < 0)
260 __alignof__(struct ipstats_mib)) < 0)
261 goto err_ip; 260 goto err_ip;
262 if (snmp_mib_init((void **)idev->stats.icmpv6, 261 if (snmp_mib_init((void **)idev->stats.icmpv6,
263 sizeof(struct icmpv6_mib), 262 sizeof(struct icmpv6_mib)) < 0)
264 __alignof__(struct icmpv6_mib)) < 0)
265 goto err_icmp; 263 goto err_icmp;
266 if (snmp_mib_init((void **)idev->stats.icmpv6msg, 264 if (snmp_mib_init((void **)idev->stats.icmpv6msg,
267 sizeof(struct icmpv6msg_mib), 265 sizeof(struct icmpv6msg_mib)) < 0)
268 __alignof__(struct icmpv6msg_mib)) < 0)
269 goto err_icmpmsg; 266 goto err_icmpmsg;
270 267
271 return 0; 268 return 0;
diff --git a/net/ipv6/af_inet6.c b/net/ipv6/af_inet6.c
index 5ab8ba7a5863..90d2f723fc46 100644
--- a/net/ipv6/af_inet6.c
+++ b/net/ipv6/af_inet6.c
@@ -714,20 +714,19 @@ EXPORT_SYMBOL_GPL(ipv6_opt_accepted);
714 714
715static int __init init_ipv6_mibs(void) 715static int __init init_ipv6_mibs(void)
716{ 716{
717 if (snmp_mib_init((void **)ipv6_statistics, sizeof (struct ipstats_mib), 717 if (snmp_mib_init((void **)ipv6_statistics,
718 __alignof__(struct ipstats_mib)) < 0) 718 sizeof(struct ipstats_mib)) < 0)
719 goto err_ip_mib; 719 goto err_ip_mib;
720 if (snmp_mib_init((void **)icmpv6_statistics, sizeof (struct icmpv6_mib), 720 if (snmp_mib_init((void **)icmpv6_statistics,
721 __alignof__(struct icmpv6_mib)) < 0) 721 sizeof(struct icmpv6_mib)) < 0)
722 goto err_icmp_mib; 722 goto err_icmp_mib;
723 if (snmp_mib_init((void **)icmpv6msg_statistics, 723 if (snmp_mib_init((void **)icmpv6msg_statistics,
724 sizeof (struct icmpv6msg_mib), __alignof__(struct icmpv6_mib)) < 0) 724 sizeof(struct icmpv6msg_mib)) < 0)
725 goto err_icmpmsg_mib; 725 goto err_icmpmsg_mib;
726 if (snmp_mib_init((void **)udp_stats_in6, sizeof (struct udp_mib), 726 if (snmp_mib_init((void **)udp_stats_in6, sizeof (struct udp_mib)) < 0)
727 __alignof__(struct udp_mib)) < 0)
728 goto err_udp_mib; 727 goto err_udp_mib;
729 if (snmp_mib_init((void **)udplite_stats_in6, sizeof (struct udp_mib), 728 if (snmp_mib_init((void **)udplite_stats_in6,
730 __alignof__(struct udp_mib)) < 0) 729 sizeof (struct udp_mib)) < 0)
731 goto err_udplite_mib; 730 goto err_udplite_mib;
732 return 0; 731 return 0;
733 732