Commit ce7ba191 authored by gauthier's avatar gauthier
Browse files

git-svn-id: http://svn.eurecom.fr/openair4G/trunk@6178 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent 7d35d3b9
......@@ -611,6 +611,7 @@ sgw_lite_handle_sgi_endpoint_updated(
task_id_t to_task;
#if defined (ENABLE_USE_GTPU_IN_KERNEL)
static uint8_t iptable_uplink_remove_gtpu = FALSE;
char *interface_name_p = NULL;
#endif
#if defined(ENABLE_STANDALONE_EPC)
......@@ -696,11 +697,16 @@ sgw_lite_handle_sgi_endpoint_updated(
}
if (iptable_uplink_remove_gtpu == FALSE) {
if (strncasecmp("tun",sgw_app.sgw_interface_name_for_S1u_S12_S4_up, strlen("tun")) == 0) {
interface_name_p = "lo";
} else {
interface_name_p = sgw_app.sgw_interface_name_for_S1u_S12_S4_up;
}
ret = snprintf(cmd,
256,
// no "-p udp --dport 2152" because of fragmented packets
"iptables -t raw -I PREROUTING -i %s -s %u.%u.%u.%u -d %u.%u.%u.%u -p udp --dport 2152 -j GTPURH --action remove",
sgw_app.sgw_interface_name_for_S1u_S12_S4_up,
interface_name_p,
eps_bearer_entry_p->enb_ip_address_for_S1u.address.ipv4_address[0],
eps_bearer_entry_p->enb_ip_address_for_S1u.address.ipv4_address[1],
eps_bearer_entry_p->enb_ip_address_for_S1u.address.ipv4_address[2],
......
......@@ -150,7 +150,6 @@ int sgw_lite_init(char* config_file_name_pP)
spgw_system("insmod $OPENAIRCN_DIR/GTPV1-U/GTPURH/Bin/xt_GTPURH.ko", 1);
#endif
spgw_config_init(config_file_name_pP, &spgw_config);
spgw_config_process(&spgw_config);
pgw_lite_load_pool_ip_addresses();
sgw_app.s11teid2mme_hashtable = hashtable_create (8192, NULL, NULL);
......
......@@ -174,8 +174,9 @@ int spgw_config_process(spgw_config_t* config_pP) {
}
inaddr.s_addr = config_pP->sgw_config.ipv4.sgw_ipv4_address_for_S1u_S12_S4_up;
if (snprintf(system_cmd, 256,
"ip -4 addr add %s dev %s",
"ip -4 addr add %s/%d dev %s",
inet_ntoa(inaddr),
config_pP->sgw_config.ipv4.sgw_ip_netmask_for_S1u_S12_S4_up,
config_pP->sgw_config.ipv4.sgw_interface_name_for_S1u_S12_S4_up) > 0) {
ret += spgw_system(system_cmd, 1);
} else {
......@@ -479,6 +480,11 @@ int spgw_config_init(char* lib_config_file_name_pP, spgw_config_t* config_pP) {
} else {
SPGW_APP_WARN("CONFIG P-GW / NETWORK INTERFACES not found\n");
}
//!!!------------------------------------!!!
spgw_config_process(config_pP);
//!!!------------------------------------!!!
subsetting = config_setting_get_member (setting_pgw, PGW_CONFIG_STRING_IP_ADDRESS_POOL);
if(subsetting != NULL) {
sub2setting = config_setting_get_member (subsetting, PGW_CONFIG_STRING_IPV4_ADDRESS_LIST);
......
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