mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* net/sched/act_nat.c BUG
@ 2010-07-09 14:37 Rodrigo Partearroyo González
  2010-07-09 15:13 ` Eric Dumazet
  0 siblings, 1 reply; 5+ messages in thread
From: Rodrigo Partearroyo González @ 2010-07-09 14:37 UTC (permalink / raw)
  To: Herbert Xu, Linux Kernel Mailing List
  Cc: Iratxo Pichel Ortiz, Noelia Morón

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.

The proposed fix is:

Index: net/sched/act_nat.c
===================================================================
--- net/sched/act_nat.c
+++ net/sched/act_nat.c
@@ -202,7 +202,7 @@
        {
                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);

Please, consider applying it.
-- 
Rodrigo Partearroyo González
R&D Engineer

Albentia Systems S.A.
http://www.albentia.com
+34 914400213

C\Margarita Salas 22
Parque Tecnológico de Leganés
Leganés (28918)
Madrid
Spain

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2010-07-10  6:27 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-07-09 14:37 net/sched/act_nat.c BUG Rodrigo Partearroyo González
2010-07-09 15:13 ` Eric Dumazet
2010-07-09 23:23   ` Herbert Xu
2010-07-10  0:00     ` David Miller
2010-07-10  6:27     ` Eric Dumazet

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®