Skip to content

Commit

Permalink
Phonet: account for dropped RX packets
Browse files Browse the repository at this point in the history
Signed-off-by: Rémi Denis-Courmont <remi.denis-courmont@nokia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Rémi Denis-Courmont authored and David S. Miller committed Jul 24, 2009
1 parent c1dc13e commit 2e2fb4b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion net/phonet/pep.c
Original file line number Diff line number Diff line change
Expand Up @@ -346,8 +346,10 @@ static int pipe_do_rcv(struct sock *sk, struct sk_buff *skb)
break;

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;
}
__skb_pull(skb, 4);
queue = &pn->ctrlreq_queue;
goto queue;
Expand All @@ -358,10 +360,13 @@ static int pipe_do_rcv(struct sock *sk, struct sk_buff *skb)
err = sock_queue_rcv_skb(sk, skb);
if (!err)
return 0;
if (err == -ENOMEM)
atomic_inc(&sk->sk_drops);
break;
}

if (pn->rx_credits == 0) {
atomic_inc(&sk->sk_drops);
err = -ENOBUFS;
break;
}
Expand Down

0 comments on commit 2e2fb4b

Please sign in to comment.