On 8/23/19 8:05 PM, Fernando Fernandez Mancera wrote:
>
>
> On 8/23/19 2:42 PM, Pablo Neira Ayuso wrote:
>> On Fri, Aug 23, 2019 at 02:41:42PM +0200, Pablo Neira Ayuso wrote:
>>> On Thu, Aug 22, 2019 at 06:48:26PM +0200, Fernando Fernandez Mancera wrote:
>>>> @@ -1405,10 +1409,16 @@ struct nft_trans_elem {
>>>>
>>>> struct nft_trans_obj {
>>>> struct nft_object *obj;
>>>> + struct nlattr **tb;
>>>
>>> Instead of annotatint tb[] on the object, you can probably add here:
>>>
>>> union {
>>> struct quota {
>>> uint64_t consumed;
>>> uint64_t quota;
>>> } quota;
>>> };
>>>
>>> So the initial update annotates the values in the transaction.
>>>
If we follow that pattern then the indirection would need the
nft_trans_phase enum, the quota struct and also the tb[] as parameters
because in the preparation phase we always need the tb[] array.
Why is that better than annotating tb[] on the object? Sorry, I think
that I am missing something here. Thanks!
>>> I guess you will need two new indirections? Something like
>>> prepare_update() and update().
>>
>> Or you have a single update() and pass enum nft_trans_phase as
>> parameter, so this only needs one single indirection.
>>
>
> But also we would need to continue passing the 'bool commit' as a
> parameter too right? I will take a look to nft_trans_phase. Thanks! :-)