netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pablo Neira Ayuso <pablo@netfilter.org>
To: Andreas Schultz <aschultz@tpip.net>
Cc: The netfilter developer mailinglist <netfilter-devel@vger.kernel.org>
Subject: Re: [nft] deleting chains and verdict map entries in the same transaction
Date: Tue, 8 Sep 2015 12:46:31 +0200	[thread overview]
Message-ID: <20150908104631.GB3879@salvia> (raw)
In-Reply-To: <1697265942.3578653.1441619142130.JavaMail.zimbra@tpip.net>

On Mon, Sep 07, 2015 at 11:45:42AM +0200, Andreas Schultz wrote:
> Hi,
> 
> I'm trying to delete a verdict map entry and the chain it points to
> in the same nft transaction. This currently fails with:
> 
>    Error: Could not process rule: Device or resource busy
> 
> existing rules:
> 
>  nft list table mangle
> table ip mangle {
> 	map client_to_any { 
> 		type mark : verdict
> 		elements = { 0x00000080 : jump BIn_1, 0x00000100 : jump BIn_2}
> 	}
> 
> 	map any_to_client { 
> 		type mark : verdict
> 		elements = { 0x00000100 : jump BOut_2, 0x00000080 : jump BOut_1}
> 	}
> 
> ...
> 
> 	chain BIn_1 {
> 		counter packets 133 bytes 63243 
> 	}
> 
> 	chain BOut_1 {
> 		counter packets 136 bytes 34430 
> 	}
> }
> 
> delete script:
> 
> # cat /tmp/nft-18536-delete-1.tmp  
> delete element mangle client_to_any { 0x00000080 : jump BIn_1 }
> delete element mangle any_to_client { 0x00000080 : jump BOut_1 }
> delete chain ip mangle BIn_1
> delete chain ip mangle BOut_1
> 
> Result:
> 
> # nft -f  /tmp/nft-18536-delete-1.tmp 
> /tmp/nft-18536-delete-1.tmp:3:1-29: Error: Could not process rule: Device or resource busy
> delete chain ip mangle BIn_1
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> /tmp/nft-18536-delete-1.tmp:4:1-30: Error: Could not process rule: Device or resource busy
> delete chain ip mangle BOut_1
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 
> 
> nft is from git://git.netfilter.org/nftables @ cba42084057b6de61d95d87177f0f8c01db539ab (HEAD)
> kernel is 4.2.0-rc6 with net-next applied from Aug 18th)
> 
> Does it make sense to update to a newer kernel (4.2-final or current net-next) or is this
> expected behavior?

The kernel should allow this.

Will be sending patches for this soon. Will you have some time to
test? If so I would be glad to add your Tested-by: tag to the patch.

      reply	other threads:[~2015-09-08 10:40 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-07  9:45 [nft] deleting chains and verdict map entries in the same transaction Andreas Schultz
2015-09-08 10:46 ` Pablo Neira Ayuso [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150908104631.GB3879@salvia \
    --to=pablo@netfilter.org \
    --cc=aschultz@tpip.net \
    --cc=netfilter-devel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).