diff options
author | Pravin B Shelar <pshelar@nicira.com> | 2013-02-22 07:30:30 +0000 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-02-25 15:47:41 -0500 |
commit | 490ab08127cebc25e3a260a74556b56ce5f47c0f (patch) | |
tree | 61a662927a56a72ae7d567728edae1ce2bc9c8c5 /net/ipv4/af_inet.c | |
parent | 2bedc2e65bf58676afc4b380617327e018a97270 (diff) |
IP_GRE: Fix IP-Identification.
GRE-GSO generates ip fragments with id 0,2,3,4... for every
GSO packet, which is not correct. Following patch fixes it
by setting ip-header id unique id of fragments are allowed.
As Eric Dumazet suggested it is optimized by using inner ip-header
whenever inner packet is ipv4.
Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/af_inet.c')
-rw-r--r-- | net/ipv4/af_inet.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/net/ipv4/af_inet.c b/net/ipv4/af_inet.c index 15847e19b7d..68f6a94f766 100644 --- a/net/ipv4/af_inet.c +++ b/net/ipv4/af_inet.c @@ -1332,8 +1332,10 @@ static struct sk_buff *inet_gso_segment(struct sk_buff *skb, if (skb->next != NULL) iph->frag_off |= htons(IP_MF); offset += (skb->len - skb->mac_len - iph->ihl * 4); - } else - iph->id = htons(id++); + } else { + if (!(iph->frag_off & htons(IP_DF))) + iph->id = htons(id++); + } iph->tot_len = htons(skb->len - skb->mac_len); iph->check = 0; iph->check = ip_fast_csum(skb_network_header(skb), iph->ihl); |