diff options
author | Rémi Denis-Courmont <remi.denis-courmont@nokia.com> | 2009-07-20 21:57:58 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-07-23 20:58:20 -0400 |
commit | 2eee40c7f7c3734b28456169b2945e07d5ac0e2d (patch) | |
tree | a62f51b3142374d34adc49b7c571e04498185f6c /net/phonet | |
parent | 2e2fb4b33d62c742019774c5e6e47711a3d60505 (diff) |
Phonet: dropped datagrams accounting
The per-socket drop count is visible via /proc/net/phonet.
Signed-off-by: Rémi Denis-Courmont <remi.denis-courmont@nokia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/phonet')
-rw-r--r-- | net/phonet/datagram.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/net/phonet/datagram.c b/net/phonet/datagram.c index e087862ed7e4..ef5c75c372e4 100644 --- a/net/phonet/datagram.c +++ b/net/phonet/datagram.c | |||
@@ -159,8 +159,11 @@ out_nofree: | |||
159 | static int pn_backlog_rcv(struct sock *sk, struct sk_buff *skb) | 159 | static int pn_backlog_rcv(struct sock *sk, struct sk_buff *skb) |
160 | { | 160 | { |
161 | int err = sock_queue_rcv_skb(sk, skb); | 161 | int err = sock_queue_rcv_skb(sk, skb); |
162 | if (err < 0) | 162 | if (err < 0) { |
163 | kfree_skb(skb); | 163 | kfree_skb(skb); |
164 | if (err == -ENOMEM) | ||
165 | atomic_inc(&sk->sk_drops); | ||
166 | } | ||
164 | return err ? NET_RX_DROP : NET_RX_SUCCESS; | 167 | return err ? NET_RX_DROP : NET_RX_SUCCESS; |
165 | } | 168 | } |
166 | 169 | ||