Skip to contentSkip to conversation

netfilter: conntrack: dccp: try not to drop skb in conntrack

PATCH RESEND New Jason Xing 1 participant 1 message Mar 25, 2024

Subsystems (2)
lore
Share & tools
lore

Jason Xing

author
#0 lore raw

PATCH RESEND 1/1 netfilter: conntrack: dccp: try not to drop skb in conntrack

From: Jason Xing <[email protected]>

It would be better not to drop skb in conntrack unless we have good alternatives. So we can treat the result of testing skb's header pointer as nf_conntrack_tcp_packet() does.

---
 net/netfilter/nf_conntrack_proto_dccp.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
net/netfilter/nf_conntrack_proto_dccp.c +2 -2
index e2db1f4ec2df..ebc4f733bb2e 100644
@@ -525,7 +525,7 @@ int nf_conntrack_dccp_packet(struct nf_conn *ct, struct sk_buff *skb,
 
 	dh = skb_header_pointer(skb, dataoff, sizeof(*dh), &_dh.dh);
 	if (!dh)
-		return NF_DROP;
+		return -NF_ACCEPT;
 
 	if (dccp_error(dh, skb, dataoff, state))
 		return -NF_ACCEPT;
@@ -533,7 +533,7 @@ int nf_conntrack_dccp_packet(struct nf_conn *ct, struct sk_buff *skb,
 	/* pull again, including possible 48 bit sequences and subtype header */
 	dh = dccp_header_pointer(skb, dataoff, dh, &_dh);
 	if (!dh)
-		return NF_DROP;
+		return -NF_ACCEPT;
 
 	type = dh->dccph_type;
 	if (!nf_ct_is_confirmed(ct) && !dccp_new(ct, skb, dh, state))
Signature · 1 line
2.37.3