Commit dc906ca8 authored by Lionel Gauthier's avatar Lionel Gauthier

Not working today on enb host (masquerading not working because of network source of UE)

git-svn-id: http://svn.eurecom.fr/openair4G/trunk@6238 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent d310a0ce
...@@ -28,6 +28,9 @@ ...@@ -28,6 +28,9 @@
#include <net/netfilter/ipv4/nf_defrag_ipv4.h> #include <net/netfilter/ipv4/nf_defrag_ipv4.h>
#endif #endif
#define ROUTE_PACKET 1
#include "xt_GTPURH.h" #include "xt_GTPURH.h"
#if !(defined KVERSION) #if !(defined KVERSION)
...@@ -366,9 +369,10 @@ static bool _gtpurh_route_packet(struct sk_buff *skb_pP, const struct xt_gtpurh_ ...@@ -366,9 +369,10 @@ static bool _gtpurh_route_packet(struct sk_buff *skb_pP, const struct xt_gtpurh_
} }
} }
}; };
skb_pP->pkt_type = PACKET_OTHERHOST;
#if 0 #if 1
pr_info("GTPURH(%d): Routing packet: %d.%d.%d.%d --> %d.%d.%d.%d Proto: %d, Len: %d Mark: %u\n", pr_info("GTPURH(%d): Routing packet: %d.%d.%d.%d --> %d.%d.%d.%d Proto: %d, Len: %d Mark: %u Packet type: %u\n",
info_pP->action, info_pP->action,
iph_p->saddr & 0xFF, iph_p->saddr & 0xFF,
(iph_p->saddr & 0x0000FF00) >> 8, (iph_p->saddr & 0x0000FF00) >> 8,
...@@ -380,9 +384,9 @@ static bool _gtpurh_route_packet(struct sk_buff *skb_pP, const struct xt_gtpurh_ ...@@ -380,9 +384,9 @@ static bool _gtpurh_route_packet(struct sk_buff *skb_pP, const struct xt_gtpurh_
iph_p->daddr >> 24, iph_p->daddr >> 24,
iph_p->protocol, iph_p->protocol,
ntohs(iph_p->tot_len), ntohs(iph_p->tot_len),
skb_pP->mark); skb_pP->mark,
skb_pP->pkt_type);
#endif #endif
rt = ip_route_output_key(&init_net, &fl.u.ip4); rt = ip_route_output_key(&init_net, &fl.u.ip4);
if (err != 0) if (err != 0)
{ {
...@@ -390,7 +394,7 @@ static bool _gtpurh_route_packet(struct sk_buff *skb_pP, const struct xt_gtpurh_ ...@@ -390,7 +394,7 @@ static bool _gtpurh_route_packet(struct sk_buff *skb_pP, const struct xt_gtpurh_
return GTPURH_FAILURE; return GTPURH_FAILURE;
} }
#if 0 #if 1
if (rt->dst.dev) if (rt->dst.dev)
{ {
pr_info("GTPURH: dst dev name %s\n", rt->dst.dev->name); pr_info("GTPURH: dst dev name %s\n", rt->dst.dev->name);
...@@ -575,6 +579,7 @@ _gtpurh_target_rem(struct sk_buff *orig_skb_pP, const struct xt_gtpurh_target_in ...@@ -575,6 +579,7 @@ _gtpurh_target_rem(struct sk_buff *orig_skb_pP, const struct xt_gtpurh_target_in
#else #else
skb_p = orig_skb_pP; skb_p = orig_skb_pP;
#endif #endif
pr_info("GTPURH(%d) IP packet arrived\n",tgi_pP->action);
//--------------------------- //---------------------------
// check if is GTPU TUNNEL // check if is GTPU TUNNEL
if (iph_p->protocol != IPPROTO_UDP) { if (iph_p->protocol != IPPROTO_UDP) {
...@@ -691,6 +696,7 @@ _gtpurh_target_rem(struct sk_buff *orig_skb_pP, const struct xt_gtpurh_target_in ...@@ -691,6 +696,7 @@ _gtpurh_target_rem(struct sk_buff *orig_skb_pP, const struct xt_gtpurh_target_in
} }
} }
//#endif //#endif
pr_info("GTPURH(%d) IP packet prcessed\n",tgi_pP->action);
/* Route the packet */ /* Route the packet */
#if defined(ROUTE_PACKET) #if defined(ROUTE_PACKET)
...@@ -725,7 +731,8 @@ static struct xt_target xt_gtpurh_reg __read_mostly = ...@@ -725,7 +731,8 @@ static struct xt_target xt_gtpurh_reg __read_mostly =
.name = "GTPURH", .name = "GTPURH",
.revision = 0, .revision = 0,
.family = AF_INET, .family = AF_INET,
.hooks = (1 << NF_INET_PRE_ROUTING), .hooks = (1 << NF_INET_PRE_ROUTING) |
(1 << NF_INET_LOCAL_OUT),
.table = "raw", .table = "raw",
.target = xt_gtpurh_target, .target = xt_gtpurh_target,
.targetsize = sizeof(struct xt_gtpurh_target_info), .targetsize = sizeof(struct xt_gtpurh_target_info),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment