From: Rémi Denis-Courmont Date: Tue, 21 Jul 2009 01:57:58 +0000 (+0000) Subject: Phonet: dropped datagrams accounting X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=2eee40c7f7c3734b28456169b2945e07d5ac0e2d;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git Phonet: dropped datagrams accounting The per-socket drop count is visible via /proc/net/phonet. Signed-off-by: Rémi Denis-Courmont Signed-off-by: David S. Miller --- 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: static int pn_backlog_rcv(struct sock *sk, struct sk_buff *skb) { int err = sock_queue_rcv_skb(sk, skb); - if (err < 0) + if (err < 0) { kfree_skb(skb); + if (err == -ENOMEM) + atomic_inc(&sk->sk_drops); + } return err ? NET_RX_DROP : NET_RX_SUCCESS; }