Commit 25c7704d authored by Pravin B Shelar's avatar Pravin B Shelar Committed by David S. Miller

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 490ab081
(IP_GRE: Fix IP-Identification).

Following patch fixes it so that identification is always
incremented.
Reported-by: default avatarCong Wang <amwang@redhat.com>
Acked-by: default avatarCong Wang <amwang@redhat.com>
Signed-off-by: default avatarPravin B Shelar <pshelar@nicira.com>
parent 5594c321
...@@ -74,15 +74,11 @@ static inline void tunnel_ip_select_ident(struct sk_buff *skb, ...@@ -74,15 +74,11 @@ static inline void tunnel_ip_select_ident(struct sk_buff *skb,
{ {
struct iphdr *iph = ip_hdr(skb); struct iphdr *iph = ip_hdr(skb);
if (iph->frag_off & htons(IP_DF)) /* Use inner packet iph-id if possible. */
iph->id = 0; if (skb->protocol == htons(ETH_P_IP) && old_iph->id)
else { iph->id = old_iph->id;
/* Use inner packet iph-id if possible. */ else
if (skb->protocol == htons(ETH_P_IP) && old_iph->id) __ip_select_ident(iph, dst,
iph->id = old_iph->id; (skb_shinfo(skb)->gso_segs ?: 1) - 1);
else
__ip_select_ident(iph, dst,
(skb_shinfo(skb)->gso_segs ?: 1) - 1);
}
} }
#endif #endif
...@@ -1334,8 +1334,7 @@ static struct sk_buff *inet_gso_segment(struct sk_buff *skb, ...@@ -1334,8 +1334,7 @@ static struct sk_buff *inet_gso_segment(struct sk_buff *skb,
iph->frag_off |= htons(IP_MF); iph->frag_off |= htons(IP_MF);
offset += (skb->len - skb->mac_len - iph->ihl * 4); offset += (skb->len - skb->mac_len - iph->ihl * 4);
} else { } 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->tot_len = htons(skb->len - skb->mac_len);
iph->check = 0; iph->check = 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment