public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Eric Dumazet <eric.dumazet@gmail.com>
To: "Rodrigo Partearroyo González" <rpartearroyo@albentia.com>
Cc: "Herbert Xu" <herbert@gondor.apana.org.au>,
	"Linux Kernel Mailing List" <linux-kernel@vger.kernel.org>,
	"Iratxo Pichel Ortiz" <ipichel@albentia.com>,
	"Noelia Morón" <nmoron@albentia.com>,
	netdev <netdev@vger.kernel.org>
Subject: Re: [PATCH 001/001] QoS and/or fair queueing: Stateless NAT BUG
Date: Fri, 09 Jul 2010 19:54:23 +0200	[thread overview]
Message-ID: <1278698063.2696.61.camel@edumazet-laptop> (raw)
In-Reply-To: <201007091937.17349.rpartearroyo@albentia.com>

Le vendredi 09 juillet 2010 à 19:37 +0200, Rodrigo Partearroyo González
a écrit :
> Hi all,
> I have been testing Stateless NAT and found that ICMP packets with length
> less than 20 bytes were not correctly NAT'ed. I have found a BUG that
> makes taking into account IP header length twice, so ICMP packets smaller
> than 20 bytes were being dropped.
> 
> Proposed formal patch is below, as suggested by Eric Dumazet, thanks.
> It is taken from 2.6.34.1 stable version.
> 
> Signed-off-by: Rodrigo Partearroyo González <rpartearroyo@albentia.com>

Acked-by: Eric Dumazet <eric.dumazet@gmail.com>

> ---
> diff -uprN a/net/sched/act_nat.c b/net/sched/act_nat.c
> --- a/net/sched/act_nat.c	2010-07-09 18:25:18.000000000 +0200
> +++ b/net/sched/act_nat.c	2010-07-09 18:26:16.000000000 +0200
> @@ -202,7 +202,7 @@ static int tcf_nat(struct sk_buff *skb, 
>  	{
>  		struct icmphdr *icmph;
>  
> -		if (!pskb_may_pull(skb, ihl + sizeof(*icmph) + sizeof(*iph)))
> +		if (!pskb_may_pull(skb, ihl + sizeof(*icmph)))
>  			goto drop;
>  
>  		icmph = (void *)(skb_network_header(skb) + ihl);
> @@ -223,7 +223,7 @@ static int tcf_nat(struct sk_buff *skb, 
>  
>  		if (skb_cloned(skb) &&
>  		    !skb_clone_writable(skb,
> -					ihl + sizeof(*icmph) + sizeof(*iph)) &&
> +					ihl + sizeof(*icmph)) &&
>  		    pskb_expand_head(skb, 0, 0, GFP_ATOMIC))
>  			goto drop;
> 

  parent reply	other threads:[~2010-07-09 17:54 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-09 17:37 [PATCH 001/001] QoS and/or fair queueing: Stateless NAT BUG Rodrigo Partearroyo González
2010-07-09 17:52 ` David Miller
2010-07-09 17:54 ` Eric Dumazet [this message]
  -- strict thread matches above, loose matches on Subject: below --
2010-07-09 16:35 rpartearroyo
2010-07-09 17:19 ` Rodrigo Partearroyo González

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=1278698063.2696.61.camel@edumazet-laptop \
    --to=eric.dumazet@gmail.com \
    --cc=herbert@gondor.apana.org.au \
    --cc=ipichel@albentia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=nmoron@albentia.com \
    --cc=rpartearroyo@albentia.com \
    /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