On Mon, May 3, 2010 07:25, David Miller wrote: > From: Simon Arlott <simon@xxxxxxxxxxx> > Date: Fri, 30 Apr 2010 19:41:17 +0100 >> @@ -1572,8 +1572,18 @@ ppp_input(struct ppp_channel *chan, struct sk_buff *skb) >> return; >> } >> >> - proto = PPP_PROTO(skb); >> + >> read_lock_bh(&pch->upl); >> + if (!pskb_may_pull(skb, 2)) { > > This makes the skb->len == 0 test at the beginning completely redundant. > > Put your pskb_may_pull(skb, 2) call there and remove the skb->len==0 > check entirely. If I move pskb_may_pull(skb, 2) up to where skb->len == 0 is then it can't increment rx_length_errors because it doesn't have the read lock on pch->upl, so I can only remove the redundant skb->len == 0 if that error count is to remain. Updated patch attached. -- Simon Arlott
Attachment:
0001-ppp_generic-pull-2-bytes-so-that-PPP_PROTO-skb-is-va.patch
Description: Binary data