netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] netfilter: nfnetlink: always ACK batch end if requested
@ 2025-10-01 21:15 Nikolaos Gkarlis
  2025-10-02  9:48 ` Fernando Fernandez Mancera
                   ` (2 more replies)
  0 siblings, 3 replies; 27+ messages in thread
From: Nikolaos Gkarlis @ 2025-10-01 21:15 UTC (permalink / raw)
  To: netfilter-devel; +Cc: pablo, fw, Nikolaos Gkarlis

Before ACKs were introduced for batch begin and batch end messages,
userspace expected to receive the same number of ACKs as it sent,
unless a fatal error occurred.

To preserve this deterministic behavior, send an ACK for batch end
messages even when an error happens in the middle of the batch,
similar to how ACKs are handled for command messages.

Signed-off-by: Nikolaos Gkarlis <nickgarlis@gmail.com>
---
Hi,

I recently came across the issue introduced by bf2ac490d28c and
while trying to find a way to handle it by adding an ACK on batch
begin, end messages, I spotted what looks like an inconsistency?

I have tested this change with my userspace application and it
seems to resolve the "problem". However, I am not sure if there
is a suitable place to add a regression test, since AFAIK nft
userspace does not currently use this feature. I would be happy
to contribute a test if you could point me to the right place.

I may be missing some context, so feedback on whether this is the
right approach would be very welcome.

 net/netfilter/nfnetlink.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/net/netfilter/nfnetlink.c b/net/netfilter/nfnetlink.c
index 811d02b4c4f7..0342087ead06 100644
--- a/net/netfilter/nfnetlink.c
+++ b/net/netfilter/nfnetlink.c
@@ -600,6 +600,11 @@ static void nfnetlink_rcv_batch(struct sk_buff *skb, struct nlmsghdr *nlh,
 			status |= NFNL_BATCH_FAILURE;
 			goto replay_abort;
 		}
+
+		if (nlh->nlmsg_flags & NLM_F_ACK) {
+			memset(&extack, 0, sizeof(extack));
+			nfnl_err_add(&err_list, nlh, 0, &extack);
+		}
 	}
 
 	nfnl_err_deliver(&err_list, oskb);
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 27+ messages in thread

end of thread, other threads:[~2025-10-08 14:50 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-01 21:15 [PATCH] netfilter: nfnetlink: always ACK batch end if requested Nikolaos Gkarlis
2025-10-02  9:48 ` Fernando Fernandez Mancera
2025-10-02 10:41   ` Nikolaos Gkarlis
2025-10-02 11:03     ` Fernando Fernandez Mancera
2025-10-04  9:26       ` [PATCH v2 0/2] " Nikolaos Gkarlis
2025-10-04  9:26         ` [PATCH v2 1/2] netfilter: nfnetlink: " Nikolaos Gkarlis
2025-10-04  9:26         ` [PATCH v2 2/2] selftests: netfilter: add nfnetlink ACK handling tests Nikolaos Gkarlis
2025-10-04 10:46           ` Florian Westphal
2025-10-04 11:08             ` Nikolaos Gkarlis
2025-10-04 12:26               ` Florian Westphal
2025-10-05 10:43                 ` Nikolaos Gkarlis
2025-10-05 11:42                   ` Florian Westphal
2025-10-05 12:54                     ` [PATCH v3] " Nikolaos Gkarlis
2025-10-08 10:26                       ` Florian Westphal
2025-10-08 10:37                         ` Nikolaos Gkarlis
2025-10-08 10:39                           ` Florian Westphal
2025-10-04  9:38       ` [PATCH v2 0/2] always ACK batch end if requested Nikolaos Gkarlis
2025-10-02 10:10 ` [PATCH] netfilter: nfnetlink: " Florian Westphal
2025-10-02 10:46   ` Nikolaos Gkarlis
2025-10-07 20:33 ` Pablo Neira Ayuso
2025-10-08  7:28   ` Florian Westphal
2025-10-08 11:33     ` Pablo Neira Ayuso
2025-10-08 13:35       ` Donald Hunter
2025-10-08 14:50         ` Florian Westphal
2025-10-08  8:41   ` Nikolaos Gkarlis
2025-10-08 11:09     ` Pablo Neira Ayuso
2025-10-08 14:50       ` Nikolaos Gkarlis

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).