Re: nftables add vs replace

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

 



On 21 January 2014 13:49, Tomasz Bursztyka
<tomasz.bursztyka@xxxxxxxxxxxxxxx> wrote:
>
> I messed up on how this replace command could be used, never mind then.
>

Well, I was working on these ops:

% nft export <xml|json>
% nft import <xml|json>

The `export' patch is in shape (i'm sending it right now for you to review).

The problem comes in the `import' operation.
I think that importing the ruleset means that any previous ruleset is
wiped, and I'm working in that way.

In my import code, I flush rules (with a batch), then query sets,
delete each one, query chains, delete each and query tables, delete.
(then add the ruleset)

I surprisingly discovered that when deleting tables, I get EBUSY:

if (!list_empty(&table->chains) || !list_empty(&table->sets))
   return -EBUSY;

because the set list is not empty.
But if I add in my code a sleep(1); between deleting sets and deleting
tables, then all go fine.

Is this the race condition you were referring to, Patrick? I can send
the `import' patch if you want.
-- 
Arturo Borrero González
--
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