115
115
#include <linux/mroute.h>
116
116
#endif
117
117
118
- DEFINE_SNMP_STAT (struct linux_mib , net_statistics ) __read_mostly ;
119
-
120
118
extern void ip_mc_drop_socket (struct sock * sk );
121
119
122
120
/* The inetsw table contains everything that inet_create needs to
@@ -1348,10 +1346,15 @@ static __net_init int ipv4_mib_init_net(struct net *net)
1348
1346
if (snmp_mib_init ((void * * )net -> mib .ip_statistics ,
1349
1347
sizeof (struct ipstats_mib )) < 0 )
1350
1348
goto err_ip_mib ;
1349
+ if (snmp_mib_init ((void * * )net -> mib .net_statistics ,
1350
+ sizeof (struct linux_mib )) < 0 )
1351
+ goto err_net_mib ;
1351
1352
1352
1353
tcp_mib_init (net );
1353
1354
return 0 ;
1354
1355
1356
+ err_net_mib :
1357
+ snmp_mib_free ((void * * )net -> mib .ip_statistics );
1355
1358
err_ip_mib :
1356
1359
snmp_mib_free ((void * * )net -> mib .tcp_statistics );
1357
1360
err_tcp_mib :
@@ -1360,6 +1363,7 @@ static __net_init int ipv4_mib_init_net(struct net *net)
1360
1363
1361
1364
static __net_exit void ipv4_mib_exit_net (struct net * net )
1362
1365
{
1366
+ snmp_mib_free ((void * * )net -> mib .net_statistics );
1363
1367
snmp_mib_free ((void * * )net -> mib .ip_statistics );
1364
1368
snmp_mib_free ((void * * )net -> mib .tcp_statistics );
1365
1369
}
@@ -1371,9 +1375,6 @@ static __net_initdata struct pernet_operations ipv4_mib_ops = {
1371
1375
1372
1376
static int __init init_ipv4_mibs (void )
1373
1377
{
1374
- if (snmp_mib_init ((void * * )net_statistics ,
1375
- sizeof (struct linux_mib )) < 0 )
1376
- goto err_net_mib ;
1377
1378
if (snmp_mib_init ((void * * )icmp_statistics ,
1378
1379
sizeof (struct icmp_mib )) < 0 )
1379
1380
goto err_icmp_mib ;
@@ -1401,8 +1402,6 @@ static int __init init_ipv4_mibs(void)
1401
1402
err_icmpmsg_mib :
1402
1403
snmp_mib_free ((void * * )icmp_statistics );
1403
1404
err_icmp_mib :
1404
- snmp_mib_free ((void * * )net_statistics );
1405
- err_net_mib :
1406
1405
return - ENOMEM ;
1407
1406
}
1408
1407
@@ -1582,5 +1581,4 @@ EXPORT_SYMBOL(inet_sock_destruct);
1582
1581
EXPORT_SYMBOL (inet_stream_connect );
1583
1582
EXPORT_SYMBOL (inet_stream_ops );
1584
1583
EXPORT_SYMBOL (inet_unregister_protosw );
1585
- EXPORT_SYMBOL (net_statistics );
1586
1584
EXPORT_SYMBOL (sysctl_ip_nonlocal_bind );
0 commit comments