Re: [nf-next PATCH v2 1/2] netfilter: xt_recent: Reduce size of struct recent_entry::nstamps

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

 



On Wed, Jun 26, 2024 at 06:12:43PM +0200, Pablo Neira Ayuso wrote:
> Hi Phil,
> 
> On Fri, Jun 14, 2024 at 05:16:40PM +0200, Phil Sutter wrote:
> > There is no point in this change besides presenting its possibility
> > separate from a follow-up patch extending the size of both 'index' and
> > 'nstamps' fields.
> > 
> > The value of 'nstamps' is initialized to 1 in recent_entry_init() and
> > adjusted in recent_entry_update() to match that of 'index' if it becomes
> > larger after being incremented. Since 'index' is of type u8, it will at
> > max become 255 (and wrap to 0 afterwards). Therefore, 'nstamps' will
> > also never exceed the value 255.
> 
> Series LGTM.

Thanks for your review.

> I'd suggest you collapse these two patches while keeping the
> description above, because nstamps is shrinked here in 1/2 then it
> gets back to original u16 in 2/2.

ACK, that was the plan right from the start. :)

> Maybe something like:

I composed a new note to add to the second patch. Please review and let
me know if it's unclear or misleading.

Thanks, Phil




[Index of Archives]     [Netfitler Users]     [Berkeley Packet Filter]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux