Ali Abdallah 809066
From d9f8fbbdc0017d766dc278b6e9befaafff17fcb3 Mon Sep 17 00:00:00 2001
Ali Abdallah 809066
From: Ali Abdallah <aabdallah@suse.de>
Ali Abdallah 809066
Date: Fri, 28 May 2021 08:37:38 +0200
Ali Abdallah 809066
Subject: [PATCH] netfilter: conntrack: avoid misleading 'invalid' in log message
Ali Abdallah 809066
Patch-mainline: v5.12-rc3
Ali Abdallah 809066
Git-commit: 07b5a76e18925a595bfef44531dbf2f397bb5507
Ali Abdallah 809066
References: bsc#1183947 bsc#1185950
Ali Abdallah 809066
Ali Abdallah 809066
The packet is not flagged as invalid: conntrack will accept it and its
Ali Abdallah 809066
associated with the conntrack entry.
Ali Abdallah 809066
Ali Abdallah 809066
This happens e.g. when receiving a retransmitted SYN in SYN_RECV state.
Ali Abdallah 809066
Ali Abdallah 809066
Signed-off-by: Florian Westphal <fw@strlen.de>
Ali Abdallah 809066
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Ali Abdallah 809066
Ali Abdallah 809066
Acked-by: Ali Abdallah <aabdallah@suse.de>
Ali Abdallah 809066
---
Ali Abdallah 809066
 net/netfilter/nf_conntrack_proto_tcp.c | 5 +++--
Ali Abdallah 809066
 1 file changed, 3 insertions(+), 2 deletions(-)
Ali Abdallah 809066
Ali Abdallah 809066
diff --git a/net/netfilter/nf_conntrack_proto_tcp.c b/net/netfilter/nf_conntrack_proto_tcp.c
Ali Abdallah 809066
index 9758a7df..804ff7de 100644
Ali Abdallah 809066
--- a/net/netfilter/nf_conntrack_proto_tcp.c
Ali Abdallah 809066
+++ b/net/netfilter/nf_conntrack_proto_tcp.c
Ali Abdallah 809066
@@ -949,8 +949,9 @@ static int tcp_packet(struct nf_conn *ct,
Ali Abdallah 809066
 		spin_unlock_bh(&ct->lock);
Ali Abdallah 809066
 		if (LOG_INVALID(net, IPPROTO_TCP))
Ali Abdallah 809066
 			nf_log_packet(net, pf, 0, skb, NULL, NULL, NULL,
Ali Abdallah 809066
-				  "nf_ct_tcp: invalid packet ignored in "
Ali Abdallah 809066
-				  "state %s ", tcp_conntrack_names[old_state]);
Ali Abdallah 809066
+				  "nf_ct_tcp: packet (index %d) in dir %d ignored, "
Ali Abdallah 809066
+				  "state %s ", index, dir,
Ali Abdallah 809066
+				  tcp_conntrack_names[old_state]);
Ali Abdallah 809066
 		return NF_ACCEPT;
Ali Abdallah 809066
 	case TCP_CONNTRACK_MAX:
Ali Abdallah 809066
 		/* Special case for SYN proxy: when the SYN to the server or
Ali Abdallah 809066
-- 
Ali Abdallah 809066
2.26.2
Ali Abdallah 809066