Skip to contentSkip to conversation

fix conntrack reassembly expire code

PATCH Applied [email protected] 2 participants 3 messages Dec 7, 2012 – Dec 16, 2012 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fix conntrack reassembly expire code

From: Haibo Xi <[email protected]>

Commit b836c99fd6c9 (ipv6: unify conntrack reassembly expire code with standard one) use the standard IPv6 reassembly code(ip6_expire_frag_queue) to handle conntrack reassembly expire.

In ip6_expire_frag_queue, it invoke dev_get_by_index_rcu to get which device received this expired packet.so we must save ifindex when NF_conntrack get this packet.

With this patch applied, I can see ICMP Time Exceeded sent from the receiver when the sender sent out 1/2 fragmented IPv6 packet.

---
 net/ipv6/netfilter/nf_conntrack_reasm.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)
net/ipv6/netfilter/nf_conntrack_reasm.c +6 -1
index 22c8ea9..e7197be 100644
@@ -196,6 +196,7 @@ static int nf_ct_frag6_queue(struct frag_queue *fq, struct sk_buff *skb,
 	struct sk_buff *prev, *next;
 	unsigned int payload_len;
 	int offset, end;
+	struct net_device *dev = NULL;
 
 	if (fq->q.last_in & INET_FRAG_COMPLETE) {
 		pr_debug("Already completed\n");
@@ -311,7 +312,11 @@ found:
 	else
 		fq->q.fragments = skb;
 
-	skb->dev = NULL;
+	dev = skb->dev;
+	if (dev) {
+		fq->iif = dev->ifindex;
+		skb->dev = NULL;
+	}
 	fq->q.stamp = skb->tstamp;
 	fq->q.meat += skb->len;
 	if (payload_len > fq->q.max_size)
Signature · 1 line
1.7.0.4
#1 lore raw

Hi Haibbo,

Quoted 24 lines · On Fri, Dec 07, 2012 at 05:42:17PM +0800, [email protected] wrote:

From: Haibo Xi <[email protected]>

Commit b836c99fd6c9 (ipv6: unify conntrack reassembly expire code with standard one) use the standard IPv6 reassembly code(ip6_expire_frag_queue) to handle conntrack reassembly expire.

In ip6_expire_frag_queue, it invoke dev_get_by_index_rcu to get which device received this expired packet.so we must save ifindex when NF_conntrack get this packet.

With this patch applied, I can see ICMP Time Exceeded sent from the receiver when the sender sent out 1/2 fragmented IPv6 packet.

---
 net/ipv6/netfilter/nf_conntrack_reasm.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)
net/ipv6/netfilter/nf_conntrack_reasm.c +0 -0
index 22c8ea9..e7197be 100644

net/ipv6/netfilter/nf_conntrack_reasm.c static int nf_ct_frag6_queue(struct frag_queue *fq, struct sk_buff *skb, · line 199

Quoted 4 lines
net/ipv6/netfilter/nf_conntrack_reasm.c +1 -0
@@ -196,6 +196,7 @@ static int nf_ct_frag6_queue(struct frag_queue *fq, struct sk_buff *skb,
 	struct sk_buff *prev, *next;
 	unsigned int payload_len;
 	int offset, end;
+	struct net_device *dev = NULL;

This assignation above is superfluous.

Quoted 18 lines
net/ipv6/netfilter/nf_conntrack_reasm.c +5 -1
 	if (fq->q.last_in & INET_FRAG_COMPLETE) {
 		pr_debug("Already completed\n");
@@ -311,7 +312,11 @@ found:
 	else
 		fq->q.fragments = skb;
 
-	skb->dev = NULL;
+	dev = skb->dev;
+	if (dev) {
+		fq->iif = dev->ifindex;
+		skb->dev = NULL;
+	}
 	fq->q.stamp = skb->tstamp;
 	fq->q.meat += skb->len;
 	if (payload_len > fq->q.max_size)
Signature · 1 line
1.7.0.4

A message that is not in the archive (sent off-list or not yet received): CAOa9=yr+r6TP33j1Ugp=UveS3yuEssZcbTfRxvaBYqboW_Lz_g@mail.gmail.com

maintainer Applied
#3 lore raw
Quoted 4 lines · Haibo Xi

Hi Pablo,

Thanks for your advice.
Given below is new patch.

Applied, thanks.

Minor nitpick: Please, next time check that your mail client is sending plain text, HTML makes no good to the patch.