RFC: Probably wrong code in nf_nat_snmp_basic.c

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

 



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 :)

Cheers,
Thomas
--
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