Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
libnice
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
cpp-libs
libnice
Commits
3a9d9281
Commit
3a9d9281
authored
May 04, 2018
by
Olivier Crête
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
stund: Pass the right length for ipv6
parent
e6217f8e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
1 deletion
+5
-1
stun/tools/stund.c
stun/tools/stund.c
+5
-1
No files found.
stun/tools/stund.c
View file @
3a9d9281
...
...
@@ -100,6 +100,8 @@ int listen_socket (int fam, int type, int proto, unsigned int port)
struct
sockaddr_in6
in6
;
struct
sockaddr_storage
storage
;
}
addr
;
int
len
;
if
(
fd
==
-
1
)
{
perror
(
"Error opening IP port"
);
...
...
@@ -118,6 +120,7 @@ int listen_socket (int fam, int type, int proto, unsigned int port)
{
case
AF_INET
:
addr
.
in
.
sin_port
=
htons
(
port
);
len
=
sizeof
(
struct
sockaddr_in
);
break
;
case
AF_INET6
:
...
...
@@ -125,13 +128,14 @@ int listen_socket (int fam, int type, int proto, unsigned int port)
setsockopt
(
fd
,
SOL_IPV6
,
IPV6_V6ONLY
,
&
yes
,
sizeof
(
yes
));
#endif
addr
.
in6
.
sin6_port
=
htons
(
port
);
len
=
sizeof
(
struct
sockaddr_in6
);
break
;
default:
assert
(
0
);
/* should never be reached */
}
if
(
bind
(
fd
,
&
addr
.
addr
,
sizeof
(
struct
sockaddr
)
))
if
(
bind
(
fd
,
&
addr
.
addr
,
len
))
{
perror
(
"Error opening IP port"
);
goto
error
;
...
...
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