BUGFIX(GTP-U): Add missing ip rules in order to have point to point connection
This commit is contained in:
committed by
Frédéric Leroy
parent
b3ded7799a
commit
8bff2cff3e
@@ -247,12 +247,6 @@ function main()
|
|||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
echo "200 lte " >> /etc/iproute2/rt_tables
|
echo "200 lte " >> /etc/iproute2/rt_tables
|
||||||
fi
|
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"
|
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;
|
*esm_cause = ESM_CAUSE_SYNTACTICAL_ERROR_IN_PACKET_FILTER;
|
||||||
} else {
|
} else {
|
||||||
/* Create new dedicated EPS bearer context */
|
/* 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) {
|
if (default_ebi != ESM_EBI_UNASSIGNED) {
|
||||||
/* Dedicated EPS bearer contextx successfully created */
|
/* 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) {
|
if (ebi != ESM_EBI_UNASSIGNED) {
|
||||||
/* Create new default EPS bearer context */
|
/* 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) {
|
if (ebi != ESM_EBI_UNASSIGNED) {
|
||||||
/* Default EPS bearer contextx successfully created */
|
/* 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(
|
int esm_ebr_context_create(
|
||||||
esm_data_t *esm_data,
|
esm_data_t *esm_data, int ueid,
|
||||||
int pid, int ebi, int is_default,
|
int pid, int ebi, int is_default,
|
||||||
const network_qos_t *qos, const network_tft_t *tft)
|
const network_qos_t *qos, const network_tft_t *tft)
|
||||||
{
|
{
|
||||||
@@ -206,7 +206,7 @@ int esm_ebr_context_create(
|
|||||||
char *netmask = NULL;
|
char *netmask = NULL;
|
||||||
char broadcast[INET_ADDRSTRLEN];
|
char broadcast[INET_ADDRSTRLEN];
|
||||||
struct in_addr in_addr;
|
struct in_addr in_addr;
|
||||||
char command_line[128];
|
char command_line[500];
|
||||||
int res;
|
int res;
|
||||||
|
|
||||||
switch (pdn->type) {
|
switch (pdn->type) {
|
||||||
@@ -272,11 +272,17 @@ int esm_ebr_context_create(
|
|||||||
}
|
}
|
||||||
|
|
||||||
res = sprintf(command_line,
|
res = sprintf(command_line,
|
||||||
"ifconfig oip1 %s netmask %s broadcast %s",
|
"ifconfig oip%d %s netmask %s broadcast %s up && "
|
||||||
ipv4_addr, netmask, broadcast);
|
"ip rule add from %s/32 table %d && "
|
||||||
(void)res; /* avoid gcc warning "set but not used" */
|
"ip rule add to %s/32 table %d && "
|
||||||
// AssertFatal((res > 0) && (res < 128),
|
"ip route add default dev oip%d table %d",
|
||||||
// "error in system command line");
|
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 ",
|
LOG_TRACE(INFO, "ESM-PROC - executing %s ",
|
||||||
command_line);
|
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 ******************/
|
/****************** 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);
|
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);
|
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++)
|
for (int i = 0; i < NUMBER_OF_eNB_MAX + NUMBER_OF_UE_MAX; i++)
|
||||||
if (oai_emulation.info.oai_ifup[i] == 1) {
|
if (oai_emulation.info.oai_ifup[i] == 1) {
|
||||||
char interfaceName[8];
|
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);
|
snprintf (interfaceName, sizeof(interfaceName), "oai%d", i);
|
||||||
bringInterfaceUp (interfaceName, 0);
|
bringInterfaceUp (interfaceName, 0);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user