Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
BC
public
belle-sip
Commits
d6d8eaae
Commit
d6d8eaae
authored
Mar 24, 2014
by
Simon Morlat
Browse files
do not bind in case of random port. The system can choose a random port by itself.
parent
19f8d20a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
13 deletions
+2
-13
src/dns.c
src/dns.c
+2
-13
No files found.
src/dns.c
View file @
d6d8eaae
...
...
@@ -5550,19 +5550,8 @@ static int dns_socket(struct sockaddr *local, int type, int *error_) {
return
fd
;
if
(
*
dns_sa_port
(
local
->
sa_family
,
local
)
==
0
)
{
struct
sockaddr_storage
tmp
;
unsigned
i
,
port
;
memcpy
(
&
tmp
,
local
,
dns_sa_len
(
local
));
for
(
i
=
0
;
i
<
DNS_SO_MAXTRY
;
i
++
)
{
port
=
1025
+
(
dns_random
()
%
64510
);
*
dns_sa_port
(
tmp
.
ss_family
,
&
tmp
)
=
htons
(
port
);
if
(
0
==
bind
(
fd
,
(
struct
sockaddr
*
)
&
tmp
,
dns_sa_len
(
&
tmp
)))
return
fd
;
}
/*let the system find a random port*/
return
fd
;
}
if
(
0
==
bind
(
fd
,
local
,
dns_sa_len
(
local
)))
...
...
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