提交 2eee40c7 编写于 作者: R Rémi Denis-Courmont 提交者: David S. Miller

Phonet: dropped datagrams accounting

The per-socket drop count is visible via /proc/net/phonet.
Signed-off-by: NRémi Denis-Courmont <remi.denis-courmont@nokia.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 2e2fb4b3
...@@ -159,8 +159,11 @@ static int pn_recvmsg(struct kiocb *iocb, struct sock *sk, ...@@ -159,8 +159,11 @@ static int pn_recvmsg(struct kiocb *iocb, struct sock *sk,
static int pn_backlog_rcv(struct sock *sk, struct sk_buff *skb) static int pn_backlog_rcv(struct sock *sk, struct sk_buff *skb)
{ {
int err = sock_queue_rcv_skb(sk, skb); int err = sock_queue_rcv_skb(sk, skb);
if (err < 0) if (err < 0) {
kfree_skb(skb); kfree_skb(skb);
if (err == -ENOMEM)
atomic_inc(&sk->sk_drops);
}
return err ? NET_RX_DROP : NET_RX_SUCCESS; return err ? NET_RX_DROP : NET_RX_SUCCESS;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册