netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: simon@fire.lp0.eu
Cc: netdev@vger.kernel.org, paulus@samba.org, linux-ppp@vger.kernel.org
Subject: Re: [PATCH 1/2] ppp_generic: pull 2 bytes so that PPP_PROTO(skb) is valid
Date: Sun, 02 May 2010 23:25:20 -0700 (PDT)	[thread overview]
Message-ID: <20100502.232520.146109082.davem@davemloft.net> (raw)
In-Reply-To: <4BDB244D.40800@simon.arlott.org.uk>

From: Simon Arlott <simon@fire.lp0.eu>
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)) {
> +		kfree_skb(skb);
> +		if (pch->ppp) {
> +			++pch->ppp->dev->stats.rx_length_errors;
> +			ppp_receive_error(pch->ppp);
> +		}
> +		goto done;
> +	}
> +
> +	proto = PPP_PROTO(skb);

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.

  parent reply	other threads:[~2010-05-03  6:25 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-30 18:41 [PATCH 1/2] ppp_generic: pull 2 bytes so that PPP_PROTO(skb) is valid Simon Arlott
2010-04-30 18:41 ` [PATCH 2/2] ppp_generic: linearise skbs before passing them to pppd Simon Arlott
2010-05-03  6:27   ` David Miller
2010-05-03 16:51     ` [PATCH 2/2] ppp_generic: handle non-linear skbs when " Simon Arlott
2010-05-03  6:25 ` David Miller [this message]
2010-05-03 11:50   ` [PATCH 1/2] ppp_generic: pull 2 bytes so that PPP_PROTO(skb) is valid Simon Arlott
2010-05-03 19:49     ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100502.232520.146109082.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=linux-ppp@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=paulus@samba.org \
    --cc=simon@fire.lp0.eu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).