From patchwork Wed Jul 10 15:33:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Phil Sutter X-Patchwork-Id: 1958902 X-Patchwork-Delegate: p.ozlabs@nwl.cc Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=nwl.cc header.i=@nwl.cc header.a=rsa-sha256 header.s=mail2022 header.b=h/1rbdlr; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=2604:1380:45d1:ec00::1; helo=ny.mirrors.kernel.org; envelope-from=netfilter-devel+bounces-2967-incoming=patchwork.ozlabs.org@vger.kernel.org; receiver=patchwork.ozlabs.org) Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org [IPv6:2604:1380:45d1:ec00::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4WK22L2ldMz1xpd for ; Thu, 11 Jul 2024 01:33:46 +1000 (AEST) Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id C7CE81C212A8 for ; Wed, 10 Jul 2024 15:33:43 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 791581946D5; Wed, 10 Jul 2024 15:33:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=nwl.cc header.i=@nwl.cc header.b="h/1rbdlr" X-Original-To: netfilter-devel@vger.kernel.org Received: from orbyte.nwl.cc (orbyte.nwl.cc [151.80.46.58]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E12607641E for ; Wed, 10 Jul 2024 15:33:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=151.80.46.58 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720625610; cv=none; b=Vf76ymouAcUFw1KJj8/2LY8a91v9Ts+nf5Xo5+hR/0+JgpR5FmJ9dYsonUqbmPOz98BiZA2Ev2eADpFCaCVcGWb1EvAXy8OQkho6dwb3VsC13KeCVLY5Rfk8QhoVx8vP+8BWhhpze/O9QnKxHfovYys8mYg5ez/yJbaimliyaCs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720625610; c=relaxed/simple; bh=hNxemCaxoIo3Qe7A/SMplpjLhItcd5xPrI+p/nlWSTU=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=H6hZWJ7dRyA6p06igIrWTLmUyDH2RqO0+hjeDJjLmmdtl8dGzu/k6q37iCzKcaAPUaMJCFDvIoFEKQZCuMVAGFIi7FktGzf6lXGVnH8ffmVqc94BI77UFCOudZXhmtydMtssMInIGrmgilYOc3xUZnEzHbyCKSLqoEcZLs1LwGQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=nwl.cc; spf=pass smtp.mailfrom=nwl.cc; dkim=pass (2048-bit key) header.d=nwl.cc header.i=@nwl.cc header.b=h/1rbdlr; arc=none smtp.client-ip=151.80.46.58 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=nwl.cc Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nwl.cc DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=nwl.cc; s=mail2022; h=Content-Transfer-Encoding:MIME-Version:Message-ID:Date:Subject: Cc:To:From:Sender:Reply-To:Content-Type:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=+GqGum9x7kBOnx3fd/0jtR0GV/4hZGAdbM098v72/AU=; b=h/1rbdlrOI6UxnZL2wqc90oufP XF5nckzTRu9ynaKeuFqSp4WZ9zYPW79BZ24HJ8wzkOPyKm0nGyKTnWt6yIYwhAIW0SP9nyYxbNf4d EoJW2rUxNqJgM5qITOy9SHXKd+XkyzZGsFrEPSDTBeuX8OP/ISS9rvkgnUNDiAzWdF3x7RJJbNFs+ ULS9sWBD7TUSYdx9PMZnk11snbDox/4DYh9H8IIkXa2TIj4WzeRRv61u4A/Z8OSgIUvVBLM0I11vh M4VgWgDMEFj+xxUHkY7Rk5tabKU8CcgRDlMEEtL4y/BdwXFFvK+ooaRhn8B/syGutH4hPkFeQLf+L OPoCaRhA==; Received: from localhost ([::1] helo=xic) by orbyte.nwl.cc with esmtp (Exim 4.97.1) (envelope-from ) id 1sRZJu-000000001Mp-43D7; Wed, 10 Jul 2024 17:33:27 +0200 From: Phil Sutter To: Pablo Neira Ayuso 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 Message-ID: <20240710153322.18574-1-phil@nwl.cc> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: netfilter-devel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Cosmetics, but support unsetting anything that may be set. Fixes: 76b82c425818e ("chain: add userdata and comment support") Signed-off-by: Phil Sutter --- 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; } From patchwork Wed Jul 10 15:33:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Phil Sutter X-Patchwork-Id: 1958901 X-Patchwork-Delegate: p.ozlabs@nwl.cc Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=nwl.cc header.i=@nwl.cc header.a=rsa-sha256 header.s=mail2022 header.b=qHxljZ1o; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=147.75.48.161; helo=sy.mirrors.kernel.org; envelope-from=netfilter-devel+bounces-2966-incoming=patchwork.ozlabs.org@vger.kernel.org; receiver=patchwork.ozlabs.org) Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org [147.75.48.161]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4WK22F3WWPz1xpd for ; Thu, 11 Jul 2024 01:33:41 +1000 (AEST) Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 3A340B23C63 for ; Wed, 10 Jul 2024 15:33:41 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id EC2771946BD; Wed, 10 Jul 2024 15:33:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=nwl.cc header.i=@nwl.cc header.b="qHxljZ1o" X-Original-To: netfilter-devel@vger.kernel.org Received: from orbyte.nwl.cc (orbyte.nwl.cc [151.80.46.58]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 473C036AF8 for ; Wed, 10 Jul 2024 15:33:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=151.80.46.58 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720625610; cv=none; b=mLDVWlwIzDU3u9PmQAOuKjcWE3vqD85gxF0avdRIvF6liAaqHFdMWY7P9gvTJ3frs89WBsN3PUL6SG5aIw2oehW3XBi95k5Piim5Cx0QVSSFvAoo4rQvScf16nIHNAjdi2GHE+n7bmyNFdGy/B3jU8kw5JSeb9HqUt8d5hykS7w= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720625610; c=relaxed/simple; bh=S83wwmXfWn4jk6ObzuKf/wvYEXZVmFJj0YGHYKk+QIU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=QHpbDl8cGmW2FDKopkKGgUiDW9KVBpayc4/lJr4nPzivBXzU97Aisd4AxSTyg9iuhQp49sEmbhHy+YC6nTZwuqWvn5ly4ZQW4bekz+3B1XGnmOhU+WN6ss/RrUlJgtWSDsZOBHxipn5+gLnnPTIffRLvz/cyumUhd6ZdJ164dzU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=nwl.cc; spf=pass smtp.mailfrom=nwl.cc; dkim=pass (2048-bit key) header.d=nwl.cc header.i=@nwl.cc header.b=qHxljZ1o; arc=none smtp.client-ip=151.80.46.58 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=nwl.cc Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nwl.cc DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=nwl.cc; s=mail2022; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=bOcMhJwlb8SULiY2Vb3aXcgHA2xxXams8ViC8VTvxk8=; b=qHxljZ1ojTN5fkVAcpn6IWLKq0 PL7EsB2xinvkCUjUxKc0t0niTkXPZwa2Uu3OCqx0dyOxH89WftwvkR1ZedO3Ol7RNs+OMaRPEWATj 0jSVDh+V/lJT8cszS7V6Z8rUwiRT2xue7DfkkxHcZXqBtS6AZfwYvNPdxtfkI0LcAJ1cw2SzmlHkh m0Bi09riwT7xJmMosGFF9mIkpdgd2BjXQziYSl0z7CBhUpPSkJt6xmBnc+y5Fl5bK1ylWraHtqQmO MX5NceVk9uxqda8PPaloBXAjyIlEFZvOMoG2377la9RJjOYQPofZfhCgZMb5xKGflzcyDTg/P+5NI RtD0fmOw==; Received: from localhost ([::1] helo=xic) by orbyte.nwl.cc with esmtp (Exim 4.97.1) (envelope-from ) id 1sRZJu-000000001Mj-1lp5; Wed, 10 Jul 2024 17:33:26 +0200 From: Phil Sutter To: Pablo Neira Ayuso Cc: netfilter-devel@vger.kernel.org Subject: [libnftnl PATCH 2/2] table: Support unsetting NFTNL_TABLE_USERDATA attribute Date: Wed, 10 Jul 2024 17:33:22 +0200 Message-ID: <20240710153322.18574-2-phil@nwl.cc> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240710153322.18574-1-phil@nwl.cc> References: <20240710153322.18574-1-phil@nwl.cc> Precedence: bulk X-Mailing-List: netfilter-devel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Cosmetics, but support unsetting anything that may be set. Fixes: 99be0e6d066d7 ("table: add userdata support") Signed-off-by: Phil Sutter --- src/table.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/table.c b/src/table.c index 13f01cfbf1e6f..1a5f6f3bcc507 100644 --- a/src/table.c +++ b/src/table.c @@ -74,6 +74,9 @@ void nftnl_table_unset(struct nftnl_table *t, uint16_t attr) case NFTNL_TABLE_NAME: xfree(t->name); break; + case NFTNL_TABLE_USERDATA: + xfree(t->user.data); + break; case NFTNL_TABLE_FLAGS: case NFTNL_TABLE_HANDLE: case NFTNL_TABLE_FAMILY: