From 0a06d51cde31d00a3816078c75f2cc98e10e7ca7 Mon Sep 17 00:00:00 2001
From: Lionel Gauthier <lionel.gauthier@eurecom.fr>
Date: Tue, 28 Apr 2015 10:57:18 +0000
Subject: [PATCH] bug MTU

git-svn-id: http://svn.eurecom.fr/openair4G/trunk@7284 818b1a75-f10b-46b9-bf7c-635c3b92a50f
---
 openair-cn/GTPV1-U/GTPUAH/xt_GTPUAH.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/openair-cn/GTPV1-U/GTPUAH/xt_GTPUAH.c b/openair-cn/GTPV1-U/GTPUAH/xt_GTPUAH.c
index 63504c3a5b..54374223cd 100755
--- a/openair-cn/GTPV1-U/GTPUAH/xt_GTPUAH.c
+++ b/openair-cn/GTPV1-U/GTPUAH/xt_GTPUAH.c
@@ -268,7 +268,7 @@ _gtpuah_tg4_add(struct sk_buff *old_skb_pP, const struct xt_action_param *par_pP
 
 
   /* Create a new copy of the original skb...can't avoid :-( */
-  if ((orig_iplen + headroom_reqd) <= mtu) {
+  if ((orig_iplen + sizeof(struct iphdr) + sizeof(struct udphdr) + sizeof(struct gtpuhdr)) <= mtu) {
 
     new_skb_p = alloc_skb(headroom_reqd + orig_iplen, GFP_ATOMIC);
 
@@ -326,7 +326,6 @@ _gtpuah_tg4_add(struct sk_buff *old_skb_pP, const struct xt_action_param *par_pP
     new_iph_p->check    = ip_fast_csum((unsigned char *)new_iph_p, new_iph_p->ihl);
     skb_reset_network_header(new_skb_p);
 
-
     // CHECKSUM_NONE, CHECKSUM_UNNECESSARY, CHECKSUM_COMPLETE, CHECKSUM_PARTIAL
     new_skb_p->ip_summed = CHECKSUM_NONE;
     new_skb_p->mark      = old_skb_pP->mark;
@@ -386,7 +385,8 @@ _gtpuah_tg4_add(struct sk_buff *old_skb_pP, const struct xt_action_param *par_pP
                   NIPADDR(old_iph_p->saddr),
                   NIPADDR(old_iph_p->daddr),
                   NIPADDR(new_iph_p->saddr),
-                  NIPADDR(new_iph_p->daddr));
+                  NIPADDR(new_iph_p->daddr),
+                  new_skb_p->len);
 
 #if defined(TRACE_IN_KERN_LOG)
           _gtpuah_print_hex_octets(
-- 
GitLab