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. Fixes: bf2ac490d28c ("netfilter: nfnetlink: Handle ACK flags for batch messages") Signed-off-by: Nikolaos Gkarlis --- net/netfilter/nfnetlink.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/net/netfilter/nfnetlink.c b/net/netfilter/nfnetlink.c index 811d02b4c4f7..33acc1b94a0e 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 && status & NFNL_BATCH_DONE) { + memset(&extack, 0, sizeof(extack)); + nfnl_err_add(&err_list, nlh, 0, &extack); + } } nfnl_err_deliver(&err_list, oskb); -- 2.34.1