Commit 0d8b1cb5 authored by Imad ALAWE's avatar Imad ALAWE Committed by Frédéric Leroy

BUGFIX(GTP-U): Add missing ip rules in order to have point to point connection

parent 9bcd12b1
......@@ -247,12 +247,6 @@ function main()
if [ $? -ne 0 ]; then
echo "200 lte " >> /etc/iproute2/rt_tables
fi
ip rule add fwmark 1 table lte
ifconfig oip1 up
ip route add default dev oip1 table lte
# the actual IP address depends on the EPC/MME config file for address pool
ip route add from 192.188.0.0/24 table lte
ip route add to 192.188.0.0/24 table lte
exe_arguments="$exe_arguments -s15 -AAWGN -y1 -b1 -u1 -Q0"
......
......@@ -165,7 +165,7 @@ int esm_proc_dedicated_eps_bearer_context_request(nas_user_t *user, int ebi, int
*esm_cause = ESM_CAUSE_SYNTACTICAL_ERROR_IN_PACKET_FILTER;
} else {
/* Create new dedicated EPS bearer context */
default_ebi = esm_ebr_context_create(esm_data, pid, ebi, FALSE, qos, tft);
default_ebi = esm_ebr_context_create(esm_data, user->ueid, pid, ebi, FALSE, qos, tft);
if (default_ebi != ESM_EBI_UNASSIGNED) {
/* Dedicated EPS bearer contextx successfully created */
......
......@@ -127,7 +127,7 @@ int esm_proc_default_eps_bearer_context_request(nas_user_t *user, int pid, int e
if (ebi != ESM_EBI_UNASSIGNED) {
/* Create new default EPS bearer context */
ebi = esm_ebr_context_create(esm_data, pid, ebi, TRUE, qos, NULL);
ebi = esm_ebr_context_create(esm_data, user->ueid, pid, ebi, TRUE, qos, NULL);
if (ebi != ESM_EBI_UNASSIGNED) {
/* Default EPS bearer contextx successfully created */
......
......@@ -98,7 +98,7 @@ static int _esm_ebr_context_check_precedence(const network_tft_t *,
** **
***************************************************************************/
int esm_ebr_context_create(
esm_data_t *esm_data,
esm_data_t *esm_data, int ueid,
int pid, int ebi, int is_default,
const network_qos_t *qos, const network_tft_t *tft)
{
......@@ -206,7 +206,7 @@ int esm_ebr_context_create(
char *netmask = NULL;
char broadcast[INET_ADDRSTRLEN];
struct in_addr in_addr;
char command_line[128];
char command_line[500];
int res;
switch (pdn->type) {
......@@ -272,11 +272,17 @@ int esm_ebr_context_create(
}
res = sprintf(command_line,
"ifconfig oip1 %s netmask %s broadcast %s",
ipv4_addr, netmask, broadcast);
(void)res; /* avoid gcc warning "set but not used" */
// AssertFatal((res > 0) && (res < 128),
// "error in system command line");
"ifconfig oip%d %s netmask %s broadcast %s up && "
"ip rule add from %s/32 table %d && "
"ip rule add to %s/32 table %d && "
"ip route add default dev oip%d table %d",
ueid + 1, ipv4_addr, netmask, broadcast,
ipv4_addr, ueid + 201,
ipv4_addr, ueid + 201,
ueid + 1, ueid + 201);
if ( res<0 ) {
LOG_TRACE(WARNING, "ESM-PROC - Failed to system command string");
}
LOG_TRACE(INFO, "ESM-PROC - executing %s ",
command_line);
......
......@@ -66,7 +66,7 @@ typedef enum {
/****************** E X P O R T E D F U N C T I O N S ******************/
/****************************************************************************/
int esm_ebr_context_create(esm_data_t *esm_data, int pid, int ebi, int is_default,
int esm_ebr_context_create(esm_data_t *esm_data, int ueid, int pid, int ebi, int is_default,
const network_qos_t *qos, const network_tft_t *tft);
int esm_ebr_context_release(nas_user_t *user, int ebi, int *pid, int *bid);
......
......@@ -1886,6 +1886,9 @@ oai_shutdown (void)
for (int i = 0; i < NUMBER_OF_eNB_MAX + NUMBER_OF_UE_MAX; i++)
if (oai_emulation.info.oai_ifup[i] == 1) {
char interfaceName[8];
char command_line[100];
sprintf(command_line, "while ip rule del table %d; do true; done",i+201);
system(command_line);
snprintf (interfaceName, sizeof(interfaceName), "oai%d", i);
bringInterfaceUp (interfaceName, 0);
}
......
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