forked from acouzens/open5gs
Fix UPF/SGW-U selection bug
This commit is contained in:
parent
83388cf504
commit
0d676c4057
|
@ -57,6 +57,82 @@ logger:
|
|||
# network_instance: ims
|
||||
# source_interface: 1
|
||||
#
|
||||
# <PDN Configuration with UE Pool>
|
||||
#
|
||||
# o IPv4 Pool
|
||||
# $ sudo ip addr add 10.45.0.1/16 dev ogstun
|
||||
#
|
||||
# pdn:
|
||||
# addr: 10.45.0.1/16
|
||||
#
|
||||
# o IPv4/IPv6 Pool
|
||||
# $ sudo ip addr add 10.45.0.1/16 dev ogstun
|
||||
# $ sudo ip addr add cafe:1::1/64 dev ogstun
|
||||
#
|
||||
# pdn:
|
||||
# - addr: 10.45.0.1/16
|
||||
# - addr: cafe:1::1/64
|
||||
#
|
||||
#
|
||||
# o Specific APN(e.g 'volte') uses 10.46.0.1/16, cafe:2::1/64
|
||||
# All other APNs use 10.45.0.1/16, cafe:1::1/64
|
||||
# $ sudo ip addr add 10.45.0.1/16 dev ogstun
|
||||
# $ sudo ip addr add 10.46.0.1/16 dev ogstun
|
||||
# $ sudo ip addr add cafe:1::1/64 dev ogstun
|
||||
# $ sudo ip addr add cafe:2::1/64 dev ogstun
|
||||
#
|
||||
# pdn:
|
||||
# - addr: 10.45.0.1/16
|
||||
# - addr: cafe:1::1/64
|
||||
# - addr: 10.46.0.1/16
|
||||
# apn: volte
|
||||
# - addr: cafe:2::1/64
|
||||
# apn: volte
|
||||
#
|
||||
# o Multiple Devices (default: ogstun)
|
||||
# $ sudo ip addr add 10.45.0.1/16 dev ogstun
|
||||
# $ sudo ip addr add cafe:1::1/64 dev ogstun2
|
||||
# $ sudo ip addr add 10.46.0.1/16 dev ogstun3
|
||||
# $ sudo ip addr add cafe:2::1/64 dev ogstun3
|
||||
#
|
||||
# pdn:
|
||||
# - addr: 10.45.0.1/16
|
||||
# - addr: cafe:1::1/64
|
||||
# dev: ogstun2
|
||||
# - addr: 10.46.0.1/16
|
||||
# apn: volte
|
||||
# dev: ogstun3
|
||||
# - addr: cafe:2::1/64
|
||||
# apn: volte
|
||||
# dev: ogstun3
|
||||
#
|
||||
# o Pool Range Sample
|
||||
# pdn:
|
||||
# - addr: 10.45.0.1/24
|
||||
# range: 10.45.0.100-10.45.0.200
|
||||
#
|
||||
# pdn:
|
||||
# - addr: 10.45.0.1/24
|
||||
# range:
|
||||
# - 10.45.0.5-10.45.0.50
|
||||
# - 10.45.0.100-
|
||||
#
|
||||
# pdn:
|
||||
# - addr: 10.45.0.1/24
|
||||
# range:
|
||||
# - -10.45.0.200
|
||||
# - 10.45.0.210-10.45.0.220
|
||||
#
|
||||
# pdn:
|
||||
# - addr: 10.45.0.1/16
|
||||
# range:
|
||||
# - 10.45.0.100-10.45.0.200
|
||||
# - 10.45.1.100-10.45.1.200
|
||||
# - addr: cafe::1/64
|
||||
# range:
|
||||
# - cafe::a0-cafe:b0
|
||||
# - cafe::c0-cafe:d0
|
||||
#
|
||||
upf:
|
||||
pfcp:
|
||||
- addr: 127.0.0.7
|
||||
|
|
|
@ -381,43 +381,6 @@ int ogs_pfcp_context_parse_config(const char *local, const char *remote)
|
|||
|
||||
} while (ogs_yaml_iter_type(&pdn_array) ==
|
||||
YAML_SEQUENCE_NODE);
|
||||
|
||||
if (ogs_list_first(&self.subnet_list) == NULL) {
|
||||
/* The followings are default configuration
|
||||
* if no PDN configration */
|
||||
ogs_pfcp_subnet_t *subnet = NULL;
|
||||
|
||||
#if defined(__linux)
|
||||
/*
|
||||
* On Linux, we can use a persitent tun/tap interface
|
||||
* which has already been setup. As such,
|
||||
* we do not need to get the IP address
|
||||
* from configuration.
|
||||
*
|
||||
* If there is no APN and TUN mapping,
|
||||
* the default subnet is added with `ogstun` name
|
||||
*/
|
||||
subnet = ogs_pfcp_subnet_add(
|
||||
NULL, NULL, NULL, self.tun_ifname);
|
||||
ogs_assert(subnet);
|
||||
#else
|
||||
/*
|
||||
* On MacOSX/FreeBSD, There is no persitent tun/tap
|
||||
* interface, TUN IP address is required.
|
||||
* The default configuration is same as below.
|
||||
*
|
||||
* pdn:
|
||||
* - addr: 10.45.0.1/16
|
||||
* - addr: cafe::1/64
|
||||
*/
|
||||
subnet = ogs_pfcp_subnet_add(
|
||||
"10.45.0.1", "16", NULL, self.tun_ifname);
|
||||
ogs_assert(subnet);
|
||||
subnet = ogs_pfcp_subnet_add(
|
||||
"cafe::1", "64", NULL, self.tun_ifname);
|
||||
ogs_assert(subnet);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if (!strcmp(root_key, remote)) {
|
||||
|
|
|
@ -97,7 +97,9 @@ static int ogs_sbi_context_prepare(void)
|
|||
|
||||
static int ogs_sbi_context_validation(const char *local)
|
||||
{
|
||||
if (ogs_list_first(&self.server_list) == NULL) {
|
||||
/* If SMF is only used in 4G EPC, no SBI interface is required. */
|
||||
if (strcmp(local, "smf") != 0 &&
|
||||
ogs_list_first(&self.server_list) == NULL) {
|
||||
ogs_error("No %s.sbi: in '%s'", local, ogs_app()->file);
|
||||
return OGS_ERROR;
|
||||
}
|
||||
|
|
|
@ -474,9 +474,6 @@ void sgwc_sess_select_sgwu(sgwc_sess_t *sess)
|
|||
OGS_SETUP_PFCP_NODE(sess, ogs_pfcp_self()->node);
|
||||
ogs_debug("UE using SGW-U on IP[%s]",
|
||||
OGS_ADDR(&ogs_pfcp_self()->node->addr, buf));
|
||||
|
||||
/* iterate to next SGW-U in list for next UE attach */
|
||||
ogs_pfcp_self()->node = ogs_list_next(ogs_pfcp_self()->node);
|
||||
}
|
||||
|
||||
int sgwc_sess_remove(sgwc_sess_t *sess)
|
||||
|
|
|
@ -119,18 +119,6 @@ static int smf_context_prepare(void)
|
|||
|
||||
static int smf_context_validation(void)
|
||||
{
|
||||
if (self.diam_conf_path == NULL &&
|
||||
(self.diam_config->cnf_diamid == NULL ||
|
||||
self.diam_config->cnf_diamrlm == NULL ||
|
||||
self.diam_config->cnf_addr == NULL)) {
|
||||
ogs_error("No smf.freeDiameter in '%s'", ogs_app()->file);
|
||||
return OGS_ERROR;
|
||||
}
|
||||
if (ogs_list_first(&self.gtpc_list) == NULL &&
|
||||
ogs_list_first(&self.gtpc_list6) == NULL) {
|
||||
ogs_error("No smf.gtpc in '%s'", ogs_app()->file);
|
||||
return OGS_ERROR;
|
||||
}
|
||||
if (self.dns[0] == NULL && self.dns6[0] == NULL) {
|
||||
ogs_error("No smf.dns in '%s'", ogs_app()->file);
|
||||
return OGS_ERROR;
|
||||
|
@ -667,9 +655,6 @@ void smf_sess_select_upf(smf_sess_t *sess)
|
|||
OGS_SETUP_PFCP_NODE(sess, ogs_pfcp_self()->node);
|
||||
ogs_debug("UE using UPF on IP[%s]",
|
||||
OGS_ADDR(&ogs_pfcp_self()->node->addr, buf));
|
||||
|
||||
/* iterate to next UPF in list for next UE attach */
|
||||
ogs_pfcp_self()->node = ogs_list_next(ogs_pfcp_self()->node);
|
||||
}
|
||||
|
||||
smf_sess_t *smf_sess_add_by_apn(smf_ue_t *smf_ue, char *apn)
|
||||
|
|
|
@ -1042,6 +1042,14 @@ int smf_fd_init(void)
|
|||
int ret;
|
||||
struct disp_when data;
|
||||
|
||||
if (smf_self()->diam_conf_path == NULL &&
|
||||
(smf_self()->diam_config->cnf_diamid == NULL ||
|
||||
smf_self()->diam_config->cnf_diamrlm == NULL ||
|
||||
smf_self()->diam_config->cnf_addr == NULL)) {
|
||||
ogs_warn("No diameter configuration");
|
||||
return OGS_OK;
|
||||
}
|
||||
|
||||
ogs_thread_mutex_init(&sess_state_mutex);
|
||||
ogs_pool_init(&sess_state_pool, ogs_app()->pool.sess);
|
||||
|
||||
|
@ -1079,6 +1087,13 @@ void smf_fd_final(void)
|
|||
{
|
||||
int ret;
|
||||
|
||||
if (smf_self()->diam_conf_path == NULL &&
|
||||
(smf_self()->diam_config->cnf_diamid == NULL ||
|
||||
smf_self()->diam_config->cnf_diamrlm == NULL ||
|
||||
smf_self()->diam_config->cnf_addr == NULL)) {
|
||||
return;
|
||||
}
|
||||
|
||||
ret = fd_sess_handler_destroy(&smf_gx_reg, NULL);
|
||||
ogs_assert(ret == 0);
|
||||
|
||||
|
|
|
@ -96,8 +96,6 @@ int smf_gtp_open(void)
|
|||
if (smf_self()->gtpc_sock6)
|
||||
smf_self()->gtpc_addr6 = &smf_self()->gtpc_sock6->local_addr;
|
||||
|
||||
ogs_assert(smf_self()->gtpc_addr || smf_self()->gtpc_addr6);
|
||||
|
||||
return OGS_OK;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue