diff options
author | Cong Wang <amwang@redhat.com> | 2013-03-21 20:31:31 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-03-22 10:23:34 -0400 |
commit | 10c0d7ed32b7c273970a20e211c08ab46fea3c26 (patch) | |
tree | 68af70bd7995292f43fe68c541d4ba776b009442 /net/ipv4 | |
parent | e287a75c6806892c0180005c462cd3be5cf93611 (diff) |
ip_gre: increase inner ip header ID during segmentation
According to the previous discussion [1] on netdev list, DaveM insists
we should increase the IP header ID for each segmented packets.
This patch fixes it.
Cc: Pravin B Shelar <pshelar@nicira.com>
Cc: Eric Dumazet <edumazet@google.com>
Cc: "David S. Miller" <davem@davemloft.net>
Signed-off-by: Cong Wang <amwang@redhat.com>
1. http://marc.info/?t=136384172700001&r=1&w=2
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4')
-rw-r--r-- | net/ipv4/gre.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/net/ipv4/gre.c b/net/ipv4/gre.c index 7a4c710c4cdd..e20631cb4185 100644 --- a/net/ipv4/gre.c +++ b/net/ipv4/gre.c | |||
@@ -125,8 +125,9 @@ static struct sk_buff *gre_gso_segment(struct sk_buff *skb, | |||
125 | netdev_features_t enc_features; | 125 | netdev_features_t enc_features; |
126 | int ghl = GRE_HEADER_SECTION; | 126 | int ghl = GRE_HEADER_SECTION; |
127 | struct gre_base_hdr *greh; | 127 | struct gre_base_hdr *greh; |
128 | struct iphdr *iph; | ||
128 | int mac_len = skb->mac_len; | 129 | int mac_len = skb->mac_len; |
129 | int tnl_hlen; | 130 | int tnl_hlen, id; |
130 | bool csum; | 131 | bool csum; |
131 | 132 | ||
132 | if (unlikely(skb_shinfo(skb)->gso_type & | 133 | if (unlikely(skb_shinfo(skb)->gso_type & |
@@ -170,6 +171,8 @@ static struct sk_buff *gre_gso_segment(struct sk_buff *skb, | |||
170 | skb_set_network_header(skb, skb_inner_network_offset(skb)); | 171 | skb_set_network_header(skb, skb_inner_network_offset(skb)); |
171 | skb->mac_len = skb_inner_network_offset(skb); | 172 | skb->mac_len = skb_inner_network_offset(skb); |
172 | 173 | ||
174 | iph = ip_hdr(skb); | ||
175 | id = ntohs(iph->id); | ||
173 | /* segment inner packet. */ | 176 | /* segment inner packet. */ |
174 | enc_features = skb->dev->hw_enc_features & netif_skb_features(skb); | 177 | enc_features = skb->dev->hw_enc_features & netif_skb_features(skb); |
175 | segs = skb_mac_gso_segment(skb, enc_features); | 178 | segs = skb_mac_gso_segment(skb, enc_features); |
@@ -179,6 +182,8 @@ static struct sk_buff *gre_gso_segment(struct sk_buff *skb, | |||
179 | skb = segs; | 182 | skb = segs; |
180 | tnl_hlen = skb_tnl_header_len(skb); | 183 | tnl_hlen = skb_tnl_header_len(skb); |
181 | do { | 184 | do { |
185 | iph = (struct iphdr *)skb->data; | ||
186 | iph->id = htons(id++); | ||
182 | __skb_push(skb, ghl); | 187 | __skb_push(skb, ghl); |
183 | if (csum) { | 188 | if (csum) { |
184 | __be32 *pcsum; | 189 | __be32 *pcsum; |