net/sched/act_nat.c BUG

From: Rodrigo Partearroyo González
Date: Fri Jul 09 2010 - 10:47:42 EST


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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/