Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
U
UERANSIM
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
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
Libraries
UERANSIM
Commits
2d700bc4
Commit
2d700bc4
authored
Dec 24, 2021
by
aligungr
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
NTS memory leak fix
parent
5a0c1299
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
src/lib/sctp/internal.cpp
src/lib/sctp/internal.cpp
+5
-5
No files found.
src/lib/sctp/internal.cpp
View file @
2d700bc4
...
...
@@ -48,14 +48,14 @@ int CreateSocket()
void
BindSocket
(
int
sd
,
const
std
::
string
&
address
,
uint16_t
port
)
{
auto
*
addr
=
(
sockaddr
*
)
std
::
malloc
(
sizeof
(
sockaddr
))
;
std
::
memset
(
addr
,
0
,
sizeof
(
sockaddr_in
));
sockaddr
addr
=
{}
;
std
::
memset
(
&
addr
,
0
,
sizeof
(
sockaddr_in
));
int
ipVersion
=
utils
::
GetIpVersion
(
address
);
if
(
ipVersion
==
4
)
{
auto
addr4
=
(
sockaddr_in
*
)
addr
;
auto
addr4
=
(
sockaddr_in
*
)
&
addr
;
addr4
->
sin_family
=
AF_INET
;
addr4
->
sin_port
=
htons
(
port
);
...
...
@@ -64,7 +64,7 @@ void BindSocket(int sd, const std::string &address, uint16_t port)
}
else
if
(
ipVersion
==
6
)
{
auto
addr6
=
(
sockaddr_in6
*
)
addr
;
auto
addr6
=
(
sockaddr_in6
*
)
&
addr
;
addr6
->
sin6_family
=
AF_INET6
;
addr6
->
sin6_port
=
htons
(
port
);
if
(
inet_pton
(
AF_INET6
,
address
.
c_str
(),
&
(
addr6
->
sin6_addr
))
!=
1
)
...
...
@@ -73,7 +73,7 @@ void BindSocket(int sd, const std::string &address, uint16_t port)
else
ThrowError
(
"Bad IPv4 or IPv6 address."
);
if
(
sctp_bindx
(
sd
,
addr
,
1
,
SCTP_BINDX_ADD_ADDR
))
if
(
sctp_bindx
(
sd
,
&
addr
,
1
,
SCTP_BINDX_ADD_ADDR
))
ThrowError
(
"SCTP bind failed: "
,
errno
);
}
...
...
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