aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJesse Gross <jesse@nicira.com>2011-06-30 12:49:11 -0700
committerJesse Gross <jesse@nicira.com>2011-06-30 13:30:59 -0700
commitfeb83d8aae83a549e660380820df40ee2490b1d9 (patch)
tree302495d02def42bebbef62b561d153f6198793c7
parent38f2e36072c9065cae3d4fbab4a70e4f502706cd (diff)
tunneling: Force selection of an IP ID with GRE.
By default we set the DF bit on tunneled packets because we want to get path MTU discovery from the underlying network. In turn this causes Linux to leave the IP ID as 0 because it believes that fragmentation can never occur. However, with GRE fragmentation is still possible because we may get a large packet to be encapsulated and let the local IP stack do fragmentation. As long as packets are kept in order fragments are not misassociated and everything works fine. However, if there is reordering in the underlying network then packets can become corrupted. This forces selection of an IP ID for GRE packets to avoid misassociation. Bug #6128 Signed-off-by: Jesse Gross <jesse@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
-rw-r--r--datapath/vport-gre.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/datapath/vport-gre.c b/datapath/vport-gre.c
index 9c1c1cc8..46e0be82 100644
--- a/datapath/vport-gre.c
+++ b/datapath/vport-gre.c
@@ -103,9 +103,12 @@ static struct sk_buff *gre_update_header(const struct vport *vport,
0));
/*
* Allow our local IP stack to fragment the outer packet even if the
- * DF bit is set as a last resort.
+ * DF bit is set as a last resort. We also need to force selection of
+ * an IP ID here because Linux will otherwise leave it at 0 if the
+ * packet originally had DF set.
*/
skb->local_df = 1;
+ __ip_select_ident(ip_hdr(skb), dst, 0);
return skb;
}