Fix SNAT/DNAT target size checks
Subsystems (2)
PATCH 1/2 Fix SNAT/DNAT target size checks
Hi Patrick
This patch fixes two size checks in the checkentry() for SNAT and DNAT targets.
The patch to remove support for multiple ranges forgot to use IPT_ALIGN()
This isn't a problem on x86 but other archs like parisc are affected and thus can't add any SNAT/DNAT rules.
Reported and tested by a user on irc.
Please submit this patch to davem for inclusion in 2.6.11 (-rc2 was just released)
net/ipv4/netfilter/ip_nat_rule.c +2 -2
@@ -181,7 +181,7 @@ static int ipt_snat_checkentry(const chareturn 0 ; } -if (targinfosize !=sizeof (struct ip_nat_multi_range_compat )) { +if (targinfosize !=IPT_ALIGN (sizeof (struct ip_nat_multi_range_compat ))) {DEBUGP ("SNAT: Target size %u wrong for %u ranges\n" , targinfosize, mr->rangesize);return 0 ;
@@ -214,7 +214,7 @@ static int ipt_dnat_checkentry(const chareturn 0 ; } -if (targinfosize !=sizeof (struct ip_nat_multi_range_compat )) { +if (targinfosize !=IPT_ALIGN (sizeof (struct ip_nat_multi_range_compat ))) {DEBUGP ("DNAT: Target size %u wrong for %u ranges\n" , targinfosize, mr->rangesize);return 0 ;
Signature · 1 line
/Martin