Linux Netfilter development
 help / color / mirror / Atom feed
From: Phil Sutter <phil@nwl.cc>
To: Pablo Neira Ayuso <pablo@netfilter.org>
Cc: netfilter-devel@vger.kernel.org
Subject: [libnftnl PATCH 1/2] chain: Support unsetting NFTNL_CHAIN_USERDATA attribute
Date: Wed, 10 Jul 2024 17:33:21 +0200	[thread overview]
Message-ID: <20240710153322.18574-1-phil@nwl.cc> (raw)

Cosmetics, but support unsetting anything that may be set.

Fixes: 76b82c425818e ("chain: add userdata and comment support")
Signed-off-by: Phil Sutter <phil@nwl.cc>
---
 src/chain.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/chain.c b/src/chain.c
index c7026f486b104..0b68939fe21a7 100644
--- a/src/chain.c
+++ b/src/chain.c
@@ -185,6 +185,9 @@ void nftnl_chain_unset(struct nftnl_chain *c, uint16_t attr)
 			xfree(c->dev_array[i]);
 		xfree(c->dev_array);
 		break;
+	case NFTNL_CHAIN_USERDATA:
+		xfree(c->user.data);
+		break;
 	default:
 		return;
 	}
-- 
2.43.0


             reply	other threads:[~2024-07-10 15:33 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-10 15:33 Phil Sutter [this message]
2024-07-10 15:33 ` [libnftnl PATCH 2/2] table: Support unsetting NFTNL_TABLE_USERDATA attribute Phil Sutter
2024-07-10 21:09 ` [libnftnl PATCH 1/2] chain: Support unsetting NFTNL_CHAIN_USERDATA attribute Phil Sutter

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=20240710153322.18574-1-phil@nwl.cc \
    --to=phil@nwl.cc \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=pablo@netfilter.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