Skip to content

Commit 6f67c81

Browse files
xemuldavem330
authored andcommitted
mib: add net to NET_INC_STATS_USER
Signed-off-by: Pavel Emelyanov <xemul@openvz.org> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent de0744a commit 6f67c81

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

include/net/ip.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ DECLARE_SNMP_STAT(struct ipstats_mib, ip_statistics);
163163
DECLARE_SNMP_STAT(struct linux_mib, net_statistics);
164164
#define NET_INC_STATS(net, field) do { (void)net; SNMP_INC_STATS(net_statistics, field); } while (0)
165165
#define NET_INC_STATS_BH(net, field) do { (void)net; SNMP_INC_STATS_BH(net_statistics, field); } while (0)
166-
#define NET_INC_STATS_USER(field) SNMP_INC_STATS_USER(net_statistics, field)
166+
#define NET_INC_STATS_USER(net, field) do { (void)net; SNMP_INC_STATS_USER(net_statistics, field); } while (0)
167167
#define NET_ADD_STATS_BH(field, adnd) SNMP_ADD_STATS_BH(net_statistics, field, adnd)
168168
#define NET_ADD_STATS_USER(field, adnd) SNMP_ADD_STATS_USER(net_statistics, field, adnd)
169169

net/ipv4/tcp.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1153,7 +1153,7 @@ static void tcp_prequeue_process(struct sock *sk)
11531153
struct sk_buff *skb;
11541154
struct tcp_sock *tp = tcp_sk(sk);
11551155

1156-
NET_INC_STATS_USER(LINUX_MIB_TCPPREQUEUED);
1156+
NET_INC_STATS_USER(sock_net(sk), LINUX_MIB_TCPPREQUEUED);
11571157

11581158
/* RX process wants to run with disabled BHs, though it is not
11591159
* necessary */
@@ -1793,13 +1793,13 @@ void tcp_close(struct sock *sk, long timeout)
17931793
*/
17941794
if (data_was_unread) {
17951795
/* Unread data was tossed, zap the connection. */
1796-
NET_INC_STATS_USER(LINUX_MIB_TCPABORTONCLOSE);
1796+
NET_INC_STATS_USER(sock_net(sk), LINUX_MIB_TCPABORTONCLOSE);
17971797
tcp_set_state(sk, TCP_CLOSE);
17981798
tcp_send_active_reset(sk, GFP_KERNEL);
17991799
} else if (sock_flag(sk, SOCK_LINGER) && !sk->sk_lingertime) {
18001800
/* Check zero linger _after_ checking for unread data. */
18011801
sk->sk_prot->disconnect(sk, 0);
1802-
NET_INC_STATS_USER(LINUX_MIB_TCPABORTONDATA);
1802+
NET_INC_STATS_USER(sock_net(sk), LINUX_MIB_TCPABORTONDATA);
18031803
} else if (tcp_close_state(sk)) {
18041804
/* We FIN if the application ate all the data before
18051805
* zapping the connection.

0 commit comments

Comments
 (0)