/* process received packets */
while ((skb = skb_dequeue(&ap->rqueue)) != NULL) {
if (skb->cb[0])
- ppp_input_error(&ap->chan, 0);
+ ppp_input_error(&ap->chan);
ppp_input(&ap->chan, skb);
}
rcu_read_unlock_bh();
}
-/* Put a 0-length skb in the receive queue as an error indication */
void
-ppp_input_error(struct ppp_channel *chan, int code)
+ppp_input_error(struct ppp_channel *chan)
{
struct channel *pch = chan->ppp;
- struct sk_buff *skb;
struct ppp *ppp;
if (!pch)
rcu_read_lock_bh();
ppp = rcu_dereference_bh(pch->ppp);
if (ppp) {
- skb = alloc_skb(0, GFP_ATOMIC);
- if (skb) {
- skb->len = 0; /* probably unnecessary */
- skb->cb[0] = code;
- ppp_do_recv(ppp, skb, pch);
- }
+ ppp_recv_lock(ppp);
+ ppp_receive_error(ppp);
+ ppp_recv_unlock(ppp);
}
rcu_read_unlock_bh();
}
static void
ppp_receive_frame(struct ppp *ppp, struct sk_buff *skb, struct channel *pch)
{
- /* note: a 0-length skb is used as an error indication */
- if (skb->len > 0) {
- skb_checksum_complete_unset(skb);
+ skb_checksum_complete_unset(skb);
#ifdef CONFIG_PPP_MULTILINK
- /* XXX do channel-level decompression here */
- if (PPP_PROTO(skb) == PPP_MP)
- ppp_receive_mp_frame(ppp, skb, pch);
- else
+ /* 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);
- } else {
- kfree_skb(skb);
- ppp_receive_error(ppp);
- }
+ ppp_receive_nonmp_frame(ppp, skb);
}
static void
/* Called by the channel when an input error occurs, indicating
that we may have missed a packet. */
-extern void ppp_input_error(struct ppp_channel *, int code);
+extern void ppp_input_error(struct ppp_channel *);
/* Attach a channel to a given PPP unit in specified net. */
extern int ppp_register_net_channel(struct net *, struct ppp_channel *);