Phonet: account for dropped RX packets
Signed-off-by: Rémi Denis-Courmont <remi.denis-courmont@nokia.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
c1dc13e9d0
commit
2e2fb4b33d
1 changed files with 6 additions and 1 deletions
|
@ -346,8 +346,10 @@ static int pipe_do_rcv(struct sock *sk, struct sk_buff *skb)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PNS_PEP_CTRL_REQ:
|
case PNS_PEP_CTRL_REQ:
|
||||||
if (skb_queue_len(&pn->ctrlreq_queue) >= PNPIPE_CTRLREQ_MAX)
|
if (skb_queue_len(&pn->ctrlreq_queue) >= PNPIPE_CTRLREQ_MAX) {
|
||||||
|
atomic_inc(&sk->sk_drops);
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
__skb_pull(skb, 4);
|
__skb_pull(skb, 4);
|
||||||
queue = &pn->ctrlreq_queue;
|
queue = &pn->ctrlreq_queue;
|
||||||
goto queue;
|
goto queue;
|
||||||
|
@ -358,10 +360,13 @@ static int pipe_do_rcv(struct sock *sk, struct sk_buff *skb)
|
||||||
err = sock_queue_rcv_skb(sk, skb);
|
err = sock_queue_rcv_skb(sk, skb);
|
||||||
if (!err)
|
if (!err)
|
||||||
return 0;
|
return 0;
|
||||||
|
if (err == -ENOMEM)
|
||||||
|
atomic_inc(&sk->sk_drops);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pn->rx_credits == 0) {
|
if (pn->rx_credits == 0) {
|
||||||
|
atomic_inc(&sk->sk_drops);
|
||||||
err = -ENOBUFS;
|
err = -ENOBUFS;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue