1
0
Fork 0

ipv4: Fix ip-header identification for gso packets.

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

Following patch fixes it so that identification is always
incremented.

Reported-by: Cong Wang <amwang@redhat.com>
Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
wifi-calibration
Pravin B Shelar 2013-03-24 17:36:29 +00:00 committed by David S. Miller
parent 9fe16b78ee
commit 330305cc4a
2 changed files with 7 additions and 12 deletions

View File

@ -77,15 +77,11 @@ static inline void tunnel_ip_select_ident(struct sk_buff *skb,
{
struct iphdr *iph = ip_hdr(skb);
if (iph->frag_off & htons(IP_DF))
iph->id = 0;
else {
/* Use inner packet iph-id if possible. */
if (skb->protocol == htons(ETH_P_IP) && old_iph->id)
iph->id = old_iph->id;
else
__ip_select_ident(iph, dst,
(skb_shinfo(skb)->gso_segs ?: 1) - 1);
}
/* Use inner packet iph-id if possible. */
if (skb->protocol == htons(ETH_P_IP) && old_iph->id)
iph->id = old_iph->id;
else
__ip_select_ident(iph, dst,
(skb_shinfo(skb)->gso_segs ?: 1) - 1);
}
#endif

View File

@ -1333,8 +1333,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)))
iph->id = htons(id++);
iph->id = htons(id++);
}
iph->tot_len = htons(skb->len - skb->mac_len);
iph->check = 0;