Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-SMF
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenXG
OpenXG-SMF
Commits
b9eec8ac
Commit
b9eec8ac
authored
Apr 01, 2019
by
gauthier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug concurrent use of inetpton()
parent
3971b89e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
11 deletions
+12
-11
src/pgwc/pgw_config.cpp
src/pgwc/pgw_config.cpp
+12
-9
src/pgwc/pgw_config.hpp
src/pgwc/pgw_config.hpp
+0
-2
No files found.
src/pgwc/pgw_config.cpp
View file @
b9eec8ac
...
...
@@ -130,9 +130,6 @@ int pgw_config::load_itti(const Setting& itti_cfg, itti_cfg_t& cfg)
const
Setting
&
pgw_app_sched_params_cfg
=
itti_cfg
[
PGW_CONFIG_STRING_PGW_APP_SCHED_PARAMS
];
load_thread_sched_params
(
pgw_app_sched_params_cfg
,
cfg
.
pgw_app_sched_params
);
const
Setting
&
sgw_app_sched_params_cfg
=
itti_cfg
[
PGW_CONFIG_STRING_SGW_APP_SCHED_PARAMS
];
load_thread_sched_params
(
sgw_app_sched_params_cfg
,
cfg
.
sgw_app_sched_params
);
const
Setting
&
async_cmd_sched_params_cfg
=
itti_cfg
[
PGW_CONFIG_STRING_ASYNC_CMD_SCHED_PARAMS
];
load_thread_sched_params
(
async_cmd_sched_params_cfg
,
cfg
.
async_cmd_sched_params
);
...
...
@@ -180,7 +177,6 @@ int pgw_config::load_interface(const Setting& if_cfg, interface_cfg_t & cfg)
int
pgw_config
::
load
(
const
string
&
config_file
)
{
Config
cfg
;
unsigned
char
buf_in_addr
[
sizeof
(
struct
in_addr
)];
unsigned
char
buf_in6_addr
[
sizeof
(
struct
in6_addr
)];
// Read the file. If there is an error, report it and exit.
...
...
@@ -228,6 +224,8 @@ int pgw_config::load(const string& config_file)
for
(
int
i
=
0
;
i
<
count
;
i
++
)
{
const
Setting
&
ipv4_cfg
=
ipv4_pool_cfg
[
i
];
string
ipv4_range
;
unsigned
char
buf_in_addr
[
sizeof
(
struct
in_addr
)];
ipv4_cfg
.
lookupValue
(
PGW_CONFIG_STRING_RANGE
,
ipv4_range
);
std
::
vector
<
std
::
string
>
ips
;
boost
::
split
(
ips
,
ipv4_range
,
boost
::
is_any_of
(
PGW_CONFIG_STRING_IPV4_ADDRESS_RANGE_DELIMITER
),
boost
::
token_compress_on
);
...
...
@@ -236,6 +234,7 @@ int pgw_config::load(const string& config_file)
throw
(
"Bad value %s : %s in config file %s"
,
PGW_CONFIG_STRING_IPV4_ADDRESS_RANGE_DELIMITER
,
ipv4_range
.
c_str
(),
config_file
.
c_str
());
}
memset
(
buf_in_addr
,
0
,
sizeof
(
buf_in_addr
));
if
(
inet_pton
(
AF_INET
,
util
::
trim
(
ips
.
at
(
0
)).
c_str
(),
buf_in_addr
)
==
1
)
{
memcpy
(
&
ue_pool_range_low
[
num_ue_pool
],
buf_in_addr
,
sizeof
(
struct
in_addr
));
}
else
{
...
...
@@ -243,6 +242,7 @@ int pgw_config::load(const string& config_file)
throw
(
"CONFIG POOL ADDR IPV4: BAD ADDRESS in "
PGW_CONFIG_STRING_IPV4_ADDRESS_LIST
);
}
memset
(
buf_in_addr
,
0
,
sizeof
(
buf_in_addr
));
if
(
inet_pton
(
AF_INET
,
util
::
trim
(
ips
.
at
(
1
)).
c_str
(),
buf_in_addr
)
==
1
)
{
memcpy
(
&
ue_pool_range_high
[
num_ue_pool
],
buf_in_addr
,
sizeof
(
struct
in_addr
));
}
else
{
...
...
@@ -391,7 +391,7 @@ int pgw_config::load(const string& config_file)
void
pgw_config
::
display
()
{
Logger
::
pgwc_app
().
info
(
"==== EURECOM %s v%s ===="
,
PACKAGE_NAME
,
PACKAGE_VERSION
);
Logger
::
pgwc_app
().
info
(
"Configuration:"
);
Logger
::
pgwc_app
().
info
(
"Configuration
PGW-C
:"
);
Logger
::
pgwc_app
().
info
(
"- Instance ..............: %d
\n
"
,
instance
);
Logger
::
pgwc_app
().
info
(
"- PID dir ...............: %s
\n
"
,
pid_dir
.
c_str
());
...
...
@@ -412,7 +412,9 @@ void pgw_config::display ()
Logger
::
pgwc_app
().
info
(
"- "
PGW_CONFIG_STRING_IP_ADDRESS_POOL
":"
);
for
(
int
i
=
0
;
i
<
num_ue_pool
;
i
++
)
{
Logger
::
pgwc_app
().
info
(
" IPv4 pool %d ..........: %s - %s"
,
i
,
inet_ntoa
(
*
((
struct
in_addr
*
)
&
ue_pool_range_low
[
i
])),
inet_ntoa
(
*
((
struct
in_addr
*
)
&
ue_pool_range_high
[
i
])));
std
::
string
range_low
(
inet_ntoa
(
ue_pool_range_low
[
apn
[
i
].
pool_id_iv4
]));
std
::
string
range_high
(
inet_ntoa
(
ue_pool_range_high
[
apn
[
i
].
pool_id_iv4
]));
Logger
::
pgwc_app
().
info
(
" IPv4 pool %d ..........: %s - %s"
,
i
,
range_low
.
c_str
(),
range_high
.
c_str
());
}
char
str_addr6
[
INET6_ADDRSTRLEN
];
for
(
int
i
=
0
;
i
<
num_paa6_pool
;
i
++
)
{
...
...
@@ -436,9 +438,10 @@ void pgw_config::display ()
Logger
::
pgwc_app
().
info
(
" "
PGW_CONFIG_STRING_APN_NI
": %s"
,
apn
[
i
].
apn
.
c_str
());
Logger
::
pgwc_app
().
info
(
" "
PGW_CONFIG_STRING_PDN_TYPE
": %s"
,
apn
[
i
].
pdn_type
.
toString
().
c_str
());
if
(
apn
[
i
].
pool_id_iv4
>=
0
)
{
Logger
::
pgwc_app
().
info
(
" "
PGW_CONFIG_STRING_IPV4_POOL
": %d ( %s - %s)"
,
apn
[
i
].
pool_id_iv4
,
inet_ntoa
(
*
((
struct
in_addr
*
)
&
ue_pool_range_low
[
apn
[
i
].
pool_id_iv4
])),
inet_ntoa
(
*
((
struct
in_addr
*
)
&
ue_pool_range_high
[
apn
[
i
].
pool_id_iv4
])));
std
::
string
range_low
(
inet_ntoa
(
ue_pool_range_low
[
apn
[
i
].
pool_id_iv4
]));
std
::
string
range_high
(
inet_ntoa
(
ue_pool_range_high
[
apn
[
i
].
pool_id_iv4
]));
Logger
::
pgwc_app
().
info
(
" "
PGW_CONFIG_STRING_IPV4_POOL
": %d ( %s - %s)"
,
apn
[
i
].
pool_id_iv4
,
range_low
.
c_str
(),
range_high
.
c_str
());
}
if
(
apn
[
i
].
pool_id_iv6
>=
0
)
{
Logger
::
pgwc_app
().
info
(
" "
PGW_CONFIG_STRING_IPV6_POOL
": %d"
,
apn
[
i
].
pool_id_iv6
);
...
...
src/pgwc/pgw_config.hpp
View file @
b9eec8ac
...
...
@@ -117,7 +117,6 @@
#define PGW_CONFIG_STRING_S5S8_SCHED_PARAMS "S5S8_SCHED_PARAMS"
#define PGW_CONFIG_STRING_SX_SCHED_PARAMS "SX_SCHED_PARAMS"
#define PGW_CONFIG_STRING_PGW_APP_SCHED_PARAMS "PGW_APP_SCHED_PARAMS"
#define PGW_CONFIG_STRING_SGW_APP_SCHED_PARAMS "SGW_APP_SCHED_PARAMS"
#define PGW_CONFIG_STRING_ASYNC_CMD_SCHED_PARAMS "ASYNC_CMD_SCHED_PARAMS"
...
...
@@ -140,7 +139,6 @@ typedef struct itti_cfg_s {
util
::
thread_sched_params
s11_sched_params
;
util
::
thread_sched_params
sx_sched_params
;
util
::
thread_sched_params
s5s8_sched_params
;
util
::
thread_sched_params
sgw_app_sched_params
;
util
::
thread_sched_params
pgw_app_sched_params
;
util
::
thread_sched_params
async_cmd_sched_params
;
}
itti_cfg_t
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment