From ae1c3b05c1e6fa5e8cb9d69f77f8baae1cf74978 Mon Sep 17 00:00:00 2001 From: Lionel Gauthier Date: Fri, 21 Nov 2014 15:13:47 +0000 Subject: [PATCH] icmp redirects git-svn-id: http://svn.eurecom.fr/openair4G/trunk@6073 818b1a75-f10b-46b9-bf7c-635c3b92a50f --- openair-cn/SGW-LITE/spgw_config.c | 31 ++++++++++++------------------- 1 file changed, 12 insertions(+), 19 deletions(-) diff --git a/openair-cn/SGW-LITE/spgw_config.c b/openair-cn/SGW-LITE/spgw_config.c index d68fa344d4..e70c3da0e8 100755 --- a/openair-cn/SGW-LITE/spgw_config.c +++ b/openair-cn/SGW-LITE/spgw_config.c @@ -254,21 +254,13 @@ int spgw_config_init(char* lib_config_file_name_pP, spgw_config_t* config_pP) { free(cidr); #if defined (ENABLE_USE_GTPU_IN_KERNEL) - if (snprintf(system_cmd, 128, - "echo 0 > /proc/sys/net/ipv4/conf/%s/send_redirects", - config_pP->sgw_config.ipv4.sgw_interface_name_for_S1u_S12_S4_up) > 0) { - SPGW_APP_INFO("Disable send ICMP redirect: %s\n",system_cmd); - system(system_cmd); - } else { - SPGW_APP_ERROR("Disable send ICMP redirect for %s\n", - config_pP->sgw_config.ipv4.sgw_interface_name_for_S1u_S12_S4_up); - } + system("echo 0 > /proc/sys/net/ipv4/conf/all/send_redirects"); #endif in_addr_var.s_addr = config_pP->sgw_config.ipv4.sgw_ipv4_address_for_S1u_S12_S4_up; SPGW_APP_INFO("Parsing configuration file found sgw_ipv4_address_for_S1u_S12_S4_up: %s/%d on %s\n", - inet_ntoa(in_addr_var), - 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); + inet_ntoa(in_addr_var), + 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); config_pP->sgw_config.ipv4.sgw_interface_name_for_S5_S8_up = strdup(sgw_interface_name_for_S5_S8_up); @@ -280,9 +272,9 @@ int spgw_config_init(char* lib_config_file_name_pP, spgw_config_t* config_pP) { free(cidr); in_addr_var.s_addr = config_pP->sgw_config.ipv4.sgw_ipv4_address_for_S5_S8_up; SPGW_APP_INFO("Parsing configuration file found sgw_ipv4_address_for_S5_S8_up: %s/%d on %s\n", - inet_ntoa(in_addr_var), - config_pP->sgw_config.ipv4.sgw_ip_netmask_for_S5_S8_up, - config_pP->sgw_config.ipv4.sgw_interface_name_for_S5_S8_up); + inet_ntoa(in_addr_var), + config_pP->sgw_config.ipv4.sgw_ip_netmask_for_S5_S8_up, + config_pP->sgw_config.ipv4.sgw_interface_name_for_S5_S8_up); config_pP->sgw_config.ipv4.sgw_interface_name_for_S11 = strdup(sgw_interface_name_for_S11); cidr = strdup(sgw_ipv4_address_for_S11); @@ -293,9 +285,9 @@ int spgw_config_init(char* lib_config_file_name_pP, spgw_config_t* config_pP) { free(cidr); in_addr_var.s_addr = config_pP->sgw_config.ipv4.sgw_ipv4_address_for_S11; SPGW_APP_INFO("Parsing configuration file found sgw_ipv4_address_for_S11: %s/%d on %s\n", - inet_ntoa(in_addr_var), - config_pP->sgw_config.ipv4.sgw_ip_netmask_for_S11, - config_pP->sgw_config.ipv4.sgw_interface_name_for_S11); + inet_ntoa(in_addr_var), + config_pP->sgw_config.ipv4.sgw_ip_netmask_for_S11, + config_pP->sgw_config.ipv4.sgw_interface_name_for_S11); } } } @@ -348,7 +340,8 @@ int spgw_config_init(char* lib_config_file_name_pP, spgw_config_t* config_pP) { #if defined (ENABLE_USE_GTPU_IN_KERNEL) if (snprintf(system_cmd, 128, - "iptables -I POSTROUTING -t mangle -o %s -m state --state NEW -m mark ! --mark 0 ! --protocol sctp -j CONNMARK --save-mark", + //"iptables -I POSTROUTING -t mangle -o %s -m state --state NEW -m mark ! --mark 0 ! --protocol sctp -j CONNMARK --save-mark", + "iptables -I POSTROUTING -t mangle -o %s -m mark ! --mark 0 ! --protocol sctp -j CONNMARK --save-mark", config_pP->pgw_config.ipv4.pgw_interface_name_for_SGI) > 0) { SPGW_APP_INFO("Save mark: %s\n",system_cmd); system(system_cmd);