Skip to contentSkip to conversation

conntrack: Fix for ENOENT in mnl_nfct_delete_cb()

PATCH In review Phil Sutter 2 participants 3 messages Nov 5, 2024 netfilter

lore
Share & tools
lore

Phil Sutter

author reviewer
#0 lore raw

PATCH 1/1 conntrack: Fix for ENOENT in mnl_nfct_delete_cb()

Align behaviour with that of mnl_nfct_update_cb(): Just free the nf_conntrack object and return. Do not increment counter variable, and certainly do not try to print an uninitialized buffer.

Fixes a7abf3f5dc7c4 ("conntrack: skip ENOENT when -U/-D finds a stale conntrack entry")
---
 src/conntrack.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
src/conntrack.c +1 -1
index a51a3ef82fcfc..52ba4ac5e44f7 100644
@@ -2030,7 +2030,7 @@ static int mnl_nfct_delete_cb(const struct nlmsghdr *nlh, void *data)
 	if (res < 0) {
 		/* the entry has vanish in middle of the delete */
 		if (errno == ENOENT)
-			goto done;
+			goto destroy_ok;
 		exit_error(OTHER_PROBLEM,
 			   "Operation failed: %s",
 			   err2str(errno, CT_DELETE));
Signature · 1 line
2.47.0
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 3 lines · Phil Sutter

Align behaviour with that of mnl_nfct_update_cb(): Just free the nf_conntrack object and return. Do not increment counter variable, and certainly do not try to print an uninitialized buffer.

author reviewer
#2 lore raw
In reply to Phil Sutter
Quoted 6 lines · Phil Sutter

Align behaviour with that of mnl_nfct_update_cb(): Just free the nf_conntrack object and return. Do not increment counter variable, and certainly do not try to print an uninitialized buffer.

Fixes a7abf3f5dc7c4 ("conntrack: skip ENOENT when -U/-D finds a stale conntrack entry")

Patch applied.