aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/net/udp.h2
-rw-r--r--net/ipv6/udp.c11
2 files changed, 8 insertions, 5 deletions
diff --git a/include/net/udp.h b/include/net/udp.h
index 7b18cfb2fe0b..bb5b9ec85638 100644
--- a/include/net/udp.h
+++ b/include/net/udp.h
@@ -168,7 +168,7 @@ DECLARE_SNMP_STAT(struct udp_mib, udplite_stats_in6);
168#define UDP6_INC_STATS_BH(field, is_udplite) do { \ 168#define UDP6_INC_STATS_BH(field, is_udplite) do { \
169 if (is_udplite) SNMP_INC_STATS_BH(udplite_stats_in6, field); \ 169 if (is_udplite) SNMP_INC_STATS_BH(udplite_stats_in6, field); \
170 else SNMP_INC_STATS_BH(udp_stats_in6, field); } while(0) 170 else SNMP_INC_STATS_BH(udp_stats_in6, field); } while(0)
171#define UDP6_INC_STATS_USER(field, is_udplite) do { \ 171#define UDP6_INC_STATS_USER(net, field, is_udplite) do { (void)net; \
172 if (is_udplite) SNMP_INC_STATS_USER(udplite_stats_in6, field); \ 172 if (is_udplite) SNMP_INC_STATS_USER(udplite_stats_in6, field); \
173 else SNMP_INC_STATS_USER(udp_stats_in6, field); } while(0) 173 else SNMP_INC_STATS_USER(udp_stats_in6, field); } while(0)
174 174
diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c
index f91e1df0d25e..833f715e4bff 100644
--- a/net/ipv6/udp.c
+++ b/net/ipv6/udp.c
@@ -166,7 +166,8 @@ try_again:
166 goto out_free; 166 goto out_free;
167 167
168 if (!peeked) 168 if (!peeked)
169 UDP6_INC_STATS_USER(UDP_MIB_INDATAGRAMS, is_udplite); 169 UDP6_INC_STATS_USER(sock_net(sk),
170 UDP_MIB_INDATAGRAMS, is_udplite);
170 171
171 sock_recv_timestamp(msg, sk, skb); 172 sock_recv_timestamp(msg, sk, skb);
172 173
@@ -213,7 +214,7 @@ out:
213csum_copy_err: 214csum_copy_err:
214 lock_sock(sk); 215 lock_sock(sk);
215 if (!skb_kill_datagram(sk, skb, flags)) 216 if (!skb_kill_datagram(sk, skb, flags))
216 UDP6_INC_STATS_USER(UDP_MIB_INERRORS, is_udplite); 217 UDP6_INC_STATS_USER(sock_net(sk), UDP_MIB_INERRORS, is_udplite);
217 release_sock(sk); 218 release_sock(sk);
218 219
219 if (flags & MSG_DONTWAIT) 220 if (flags & MSG_DONTWAIT)
@@ -591,7 +592,8 @@ out:
591 up->len = 0; 592 up->len = 0;
592 up->pending = 0; 593 up->pending = 0;
593 if (!err) 594 if (!err)
594 UDP6_INC_STATS_USER(UDP_MIB_OUTDATAGRAMS, is_udplite); 595 UDP6_INC_STATS_USER(sock_net(sk),
596 UDP_MIB_OUTDATAGRAMS, is_udplite);
595 return err; 597 return err;
596} 598}
597 599
@@ -873,7 +875,8 @@ out:
873 * seems like overkill. 875 * seems like overkill.
874 */ 876 */
875 if (err == -ENOBUFS || test_bit(SOCK_NOSPACE, &sk->sk_socket->flags)) { 877 if (err == -ENOBUFS || test_bit(SOCK_NOSPACE, &sk->sk_socket->flags)) {
876 UDP6_INC_STATS_USER(UDP_MIB_SNDBUFERRORS, is_udplite); 878 UDP6_INC_STATS_USER(sock_net(sk),
879 UDP_MIB_SNDBUFERRORS, is_udplite);
877 } 880 }
878 return err; 881 return err;
879 882