Re: [PATCH nft 1/5] datatype: make "flags" field of datatype struct simple booleans

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

 



On Wed, Sep 27, 2023 at 09:57:24PM +0200, Thomas Haller wrote:
> Flags are not always bad. For example, as a function argument they allow
> easier extension in the future. But with datatype's "flags" argument and
> enum datatype_flags there are no advantages of this approach.
> 
> - replace DTYPE_F_PREFIX with a "bool f_prefix:1" field.
> 
> - replace DTYPE_F_ALLOC with a "bool f_alloc:1" field.
> 
> - the new boolean fields are made bitfields, although for the moment
>   that does not reduce the size of the struct. If we add more flags,
>   that will be different.

For the record, I followed a different approach to replace these:

https://patchwork.ozlabs.org/project/netfilter-devel/patch/20240819221834.972153-1-pablo@xxxxxxxxxxxxx/
https://patchwork.ozlabs.org/project/netfilter-devel/patch/20240819221834.972153-2-pablo@xxxxxxxxxxxxx/




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

  Powered by Linux