From 80eca142cb7326703e5d4ff637d5a9a3971bbbac Mon Sep 17 00:00:00 2001
From: Lionel Gauthier <lionel.gauthier@eurecom.fr>
Date: Thu, 11 Dec 2014 17:19:55 +0000
Subject: [PATCH] !!@@@###%&!?!!! bug on last 2 digits of mac address: to do

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

diff --git a/openair-cn/GTPV1-U/GTPURH/xt_GTPURH.c b/openair-cn/GTPV1-U/GTPURH/xt_GTPURH.c
index 43ee1a50c1f..5f5dc5a90cb 100755
--- a/openair-cn/GTPV1-U/GTPURH/xt_GTPURH.c
+++ b/openair-cn/GTPV1-U/GTPURH/xt_GTPURH.c
@@ -16,6 +16,7 @@
 #include <linux/init.h>
 #include <linux/skbuff.h>
 #include <linux/ip.h>
+#include <linux/if_ether.h>
 #include <linux/route.h> 
 #include <net/checksum.h>
 #include <net/ip.h>
@@ -656,12 +657,16 @@ _gtpurh_target_rem(struct sk_buff *orig_skb_pP, const struct xt_gtpurh_target_in
         skb_pull(skb_p, sizeof(short) + sizeof(char) + sizeof(char)); /* #Seq, #N-PDU, #ExtHdr Type */
         gtp_payload_size = gtp_payload_size - sizeof(short) - sizeof(char) - sizeof(char);
     }
-    //skb_p->mac_len = 0;
-    //skb_set_mac_header(skb_p, 0);
     skb_set_network_header(skb_p, 0);
     iph2_p   = ip_hdr(skb_p);
     skb_set_transport_header(skb_p, iph2_p->ihl << 2);
 
+    skb_p->mac_len = ETH_HLEN;
+    //struct ethhdr *eth = (struct ethhdr *)skb_push(skb_p, ETH_HLEN);
+    //memset(eth, 0, ETH_HLEN);
+    //eth->h_proto = htons(ETH_P_IP);
+    //skb_set_mac_header(skb_p, 0);
+
     if ((iph2_p->version  != 4 ) && (iph2_p->version  != 6)) {
         pr_info("\nGTPURH: Decapsulated packet dropped because not IPvx protocol see all GTPU packet here:\n");
         _gtpurh_print_hex_octets((unsigned char*)iph_p, ntohs(iph_p->tot_len));
@@ -722,7 +727,7 @@ _gtpurh_target_rem(struct sk_buff *orig_skb_pP, const struct xt_gtpurh_target_in
             pr_info("GTPURH: Failed to route packet to dst 0x%x. Error: (%d)", fl.u.ip4.daddr, err);
             return NF_DROP;
         }
-
+        skb_p->pkt_type = PACKET_OTHERHOST;
 #if 1
         if (rt->dst.dev) {
             pr_info("GTPURH: dst dev name %s\n", rt->dst.dev->name);
-- 
GitLab