Re: RFC: Probably wrong code in nf_nat_snmp_basic.c

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

 



On Friday, 18. November 2011 01:34:29 Pablo Neira Ayuso wrote:
> > 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.

The if() statement is probably in there for a reason. I'm not familiar with 
the internal details of the ct stuff, perhaps map.from/map.to
should be swapped or something like that.

James, any idea what's going on?

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