Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 190609
b: refs/heads/master
c: ea8420e
h: refs/heads/master
i:
  190607: 0c78922
v: v3
  • Loading branch information
Simon Arlott authored and David S. Miller committed May 3, 2010
1 parent bceb17b commit ece6cb3
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 12 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 1183f3838c588545592c042c0ce15015661ce7f2
refs/heads/master: ea8420e9f5dff7324607671f0b7ab7fbf726339d
29 changes: 18 additions & 11 deletions trunk/drivers/net/ppp_generic.c
Original file line number Diff line number Diff line change
Expand Up @@ -1567,13 +1567,22 @@ ppp_input(struct ppp_channel *chan, struct sk_buff *skb)
struct channel *pch = chan->ppp;
int proto;

if (!pch || skb->len == 0) {
if (!pch) {
kfree_skb(skb);
return;
}

proto = PPP_PROTO(skb);
read_lock_bh(&pch->upl);
if (!pskb_may_pull(skb, 2)) {
kfree_skb(skb);
if (pch->ppp) {
++pch->ppp->dev->stats.rx_length_errors;
ppp_receive_error(pch->ppp);
}
goto done;
}

proto = PPP_PROTO(skb);
if (!pch->ppp || proto >= 0xc000 || proto == PPP_CCPFRAG) {
/* put it on the channel queue */
skb_queue_tail(&pch->file.rq, skb);
Expand All @@ -1585,6 +1594,8 @@ ppp_input(struct ppp_channel *chan, struct sk_buff *skb)
} else {
ppp_do_recv(pch->ppp, skb, pch);
}

done:
read_unlock_bh(&pch->upl);
}

Expand Down Expand Up @@ -1617,23 +1628,19 @@ ppp_input_error(struct ppp_channel *chan, int code)
static void
ppp_receive_frame(struct ppp *ppp, struct sk_buff *skb, struct channel *pch)
{
if (pskb_may_pull(skb, 2)) {
/* note: a 0-length skb is used as an error indication */
if (skb->len > 0) {
#ifdef CONFIG_PPP_MULTILINK
/* XXX do channel-level decompression here */
if (PPP_PROTO(skb) == PPP_MP)
ppp_receive_mp_frame(ppp, skb, pch);
else
#endif /* CONFIG_PPP_MULTILINK */
ppp_receive_nonmp_frame(ppp, skb);
return;
} else {
kfree_skb(skb);
ppp_receive_error(ppp);
}

if (skb->len > 0)
/* note: a 0-length skb is used as an error indication */
++ppp->dev->stats.rx_length_errors;

kfree_skb(skb);
ppp_receive_error(ppp);
}

static void
Expand Down

0 comments on commit ece6cb3

Please sign in to comment.