Re: [PATCH nf-next v2 1/1] netfilter: nf_tables: Eliminate duplicated codes in nf_tables_table_enable

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

 



Hi Liping,

On Fri, Jan 20, 2017 at 6:57 PM, Liping Zhang <zlpnobody@xxxxxxxxx> wrote:
> 2017-01-20 15:42 GMT+08:00 Feng Gao <gfree.wind@xxxxxxxxx>:
> [...]
>> In v2 patch, I copied your recommend codes "if (cnt && --cnt == 0)".
>> Today I think it is not right to use "--cnt", it should use "cnt--".
>> Because when the cnt is 1, the "--cnt" would break directly.
>> So I send the v3 patch.
>
> But this "if (cnt && cnt-- == 0) break;" check condition seems still incorrect,
> when the cnt is 1, next round cnt will become 0, so we will fail to break the
> loop ...

Thanks your catch.
So we should keep the "(cnt && --cnt == 0)", with
_nf_tables_table_disable(net, afi, table, i+1) in the error handler of
nf_tables_table_enable.

Do you think if "i+1" is a little werid?

Regards
Feng
--
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