From patchwork Fri Jul 9 17:19:21 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: rpartearroyo@albentia.com X-Patchwork-Id: 58416 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 19721B6EEF for ; Sat, 10 Jul 2010 03:26:55 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756624Ab0GIR0m (ORCPT ); Fri, 9 Jul 2010 13:26:42 -0400 Received: from llsd409-a04.servidoresdns.net ([82.223.190.34]:37773 "EHLO llsd409-a04.servidoresdns.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755969Ab0GIR0m convert rfc822-to-8bit (ORCPT ); Fri, 9 Jul 2010 13:26:42 -0400 X-Greylist: delayed 431 seconds by postgrey-1.27 at vger.kernel.org; Fri, 09 Jul 2010 13:26:41 EDT Received: from albentia-rodri.localnet (unknown [83.175.223.254]) by smtp-04.servidoresdns.net (Postfix) with ESMTPA id 8B38AA80130; Fri, 9 Jul 2010 19:19:23 +0200 (CEST) From: Rodrigo Partearroyo =?iso-8859-1?q?Gonz=E1lez?= Organization: Albentia Systems To: "Eric Dumazet" Subject: Re: [PATCH 001/001] QoS and/or fair queueing: Stateless NAT BUG Date: Fri, 9 Jul 2010 19:19:21 +0200 User-Agent: KMail/1.13.2 (Linux/2.6.32-23-generic; KDE/4.4.2; i686; ; ) Cc: "Herbert Xu" , "Linux Kernel Mailing List" , "Iratxo Pichel Ortiz" , Noelia =?iso-8859-1?q?Mor=F3n?= , "netdev" References: <25524.83.175.223.254.1278693359.squirrel@mail.albentia.com> In-Reply-To: <25524.83.175.223.254.1278693359.squirrel@mail.albentia.com> MIME-Version: 1.0 Message-Id: <201007091919.22524.rpartearroyo@albentia.com> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Seems like the mailer corrupted the patch. Sorry, I resend it. Thanks Eric. On Viernes, 9 de Julio de 2010 18:35:59 rpartearroyo@albentia.com escribió: > 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 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; ---