Re: RFC: Probably wrong code in nf_nat_snmp_basic.c

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Nov 17, 2011 at 10:14:02PM +0100, Thomas Jarosch wrote:
> Hi,
> 
> consider this piece of code from
> net/ipv4/netfilter/nf_nat_snmp_basic.c:1198
> 
> ---------------------------------------------
> /*
>     * Determine mappping for application layer addresses based
>     * on NAT manipulations for the packet.
>     */
> if (dir == IP_CT_DIR_ORIGINAL) {
>     /* SNAT traps */
>     map.from = NOCT1(&ct->tuplehash[dir].tuple.src.u3.ip);
>     map.to = NOCT1(&ct->tuplehash[!dir].tuple.dst.u3.ip);
> } else {
>     /* DNAT replies */
>     map.from = NOCT1(&ct->tuplehash[dir].tuple.src.u3.ip);
>     map.to = NOCT1(&ct->tuplehash[!dir].tuple.dst.u3.ip);
> }
> ---------------------------------------------
> 
> cppcheck reported: (style) Found duplicate branches for if and else.
> 
> 
> Either I need glasses or the code is exactly the same :)

Indeed. I'll be happy to take a patch for this. If you don't make it
in the following days, no problem, I'll take of this myself. Thanks
for the report.
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Netfitler Users]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux