Skip to contentSkip to conversation

ipv4: Fix ip-header identification for gso packets.

PATCH In review Pravin B Shelar 2 participants 2 messages Mar 24, 2013

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

PATCH 1/1 ipv4: Fix ip-header identification for gso packets.

For TCP protocol ip-header id needs to be incremented even if IP_DF flag is set. This behaviour was changed in commit 490ab08127cebc25e3a26 (IP_GRE: Fix IP-Identification).

Following patch fixes it so that identification is always incremented for TCP.

---
 net/ipv4/af_inet.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
net/ipv4/af_inet.c +1 -1
index 9e5882c..4958b9d 100644
@@ -1334,7 +1334,7 @@ static struct sk_buff *inet_gso_segment(struct sk_buff *skb,
 				iph->frag_off |= htons(IP_MF);
 			offset += (skb->len - skb->mac_len - iph->ihl * 4);
 		} else  {
-			if (!(iph->frag_off & htons(IP_DF)))
+			if (proto == IPPROTO_TCP || !(iph->frag_off & htons(IP_DF)))
 				iph->id = htons(id++);
 		}
 		iph->tot_len = htons(skb->len - skb->mac_len);
Signature · 1 line
1.7.1
maintainer
#1 lore raw

From: Pravin B Shelar <[email protected]>
Date: Sat, 23 Mar 2013 21:10:48 -0700

Quoted 9 lines

For TCP protocol ip-header id needs to be incremented even if IP_DF flag is set. This behaviour was changed in commit 490ab08127cebc25e3a26 (IP_GRE: Fix IP-Identification).

Following patch fixes it so that identification is always incremented for TCP.

We should do this increment for all protocols when DF is set, not just TCP.