Re: [PATCH nf 1/2] netfilter: nft_set_bitmap: fetch the element key based on the set->klen

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

 



2017-03-07 0:42 GMT+08:00 Pablo Neira Ayuso <pablo@xxxxxxxxxxxxx>:
[...]
>> static inline void nft_register_store16(u32 *dreg, u16 value)
>> {
>>         *dreg = 0;
>>         *(u16 *)dreg = value;
>> }
>>
>> static inline void nft_register_store8(u32 *dreg, u8 value)
>> {
>>         *dreg = 0;
>>         *(u8 *)dreg = value;
>> }
>
> I think this a good idea, send patches to add this and use them for
> the nf tree, please.

OK. I will have a closer look into these.

Thanks Pablo.

>
>> ...
>>
>> Am I wrong? Or I totally misunderstood this byte-order issue?
>
> This looks correct to me.
>
> Note that:
>
> *dest = 0;
>
> is just there because of concatenations, so we make sure that we zero
> the pad given that register allocation happens at 32-bit level.
>
> Another note: For method 3. __force is there for the sparse checker
> given the different endianness of both sides of the assignment.
--
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