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
b59c4bb5
Commit
b59c4bb5
authored
Apr 08, 2014
by
Youness Alaoui
Committed by
Olivier Crête
May 15, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix crash when discovering peer reflexive candidates in RFC compat
parent
7048b757
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
8 deletions
+23
-8
agent/conncheck.c
agent/conncheck.c
+10
-3
agent/conncheck.h
agent/conncheck.h
+1
-0
agent/discovery.c
agent/discovery.c
+12
-5
No files found.
agent/conncheck.c
View file @
b59c4bb5
...
@@ -1318,8 +1318,8 @@ static void priv_add_new_check_pair (NiceAgent *agent, guint stream_id, Componen
...
@@ -1318,8 +1318,8 @@ static void priv_add_new_check_pair (NiceAgent *agent, guint stream_id, Componen
}
}
}
}
static
NiceCandidateTransport
NiceCandidateTransport
priv
_match_transport
(
NiceCandidateTransport
transport
)
conn_check
_match_transport
(
NiceCandidateTransport
transport
)
{
{
switch
(
transport
)
{
switch
(
transport
)
{
case
NICE_CANDIDATE_TRANSPORT_TCP_ACTIVE
:
case
NICE_CANDIDATE_TRANSPORT_TCP_ACTIVE
:
...
@@ -1355,7 +1355,7 @@ static gboolean priv_conn_check_add_for_candidate_pair (NiceAgent *agent, guint
...
@@ -1355,7 +1355,7 @@ static gboolean priv_conn_check_add_for_candidate_pair (NiceAgent *agent, guint
return
FALSE
;
return
FALSE
;
}
}
/* note: match pairs only if transport and address family are the same */
/* note: match pairs only if transport and address family are the same */
if
(
local
->
transport
==
priv
_match_transport
(
remote
->
transport
)
&&
if
(
local
->
transport
==
conn_check
_match_transport
(
remote
->
transport
)
&&
local
->
addr
.
s
.
addr
.
sa_family
==
remote
->
addr
.
s
.
addr
.
sa_family
)
{
local
->
addr
.
s
.
addr
.
sa_family
==
remote
->
addr
.
s
.
addr
.
sa_family
)
{
nice_debug
(
"Agent %p, Adding check pair between %s and %s"
,
agent
,
nice_debug
(
"Agent %p, Adding check pair between %s and %s"
,
agent
,
...
@@ -2966,6 +2966,13 @@ gboolean conn_check_handle_inbound_stun (NiceAgent *agent, Stream *stream,
...
@@ -2966,6 +2966,13 @@ gboolean conn_check_handle_inbound_stun (NiceAgent *agent, Stream *stream,
break
;
break
;
}
}
}
}
for
(
i
=
component
->
local_candidates
;
i
;
i
=
i
->
next
)
{
NiceCandidate
*
cand
=
i
->
data
;
if
(
cand
->
sockptr
==
nicesock
)
{
local_candidate
=
cand
;
break
;
}
}
if
(
agent
->
compatibility
==
NICE_COMPATIBILITY_GOOGLE
||
if
(
agent
->
compatibility
==
NICE_COMPATIBILITY_GOOGLE
||
agent
->
compatibility
==
NICE_COMPATIBILITY_MSN
||
agent
->
compatibility
==
NICE_COMPATIBILITY_MSN
||
...
...
agent/conncheck.h
View file @
b59c4bb5
...
@@ -91,5 +91,6 @@ void conn_check_prune_stream (NiceAgent *agent, Stream *stream);
...
@@ -91,5 +91,6 @@ void conn_check_prune_stream (NiceAgent *agent, Stream *stream);
gboolean
conn_check_handle_inbound_stun
(
NiceAgent
*
agent
,
Stream
*
stream
,
Component
*
component
,
NiceSocket
*
udp_socket
,
const
NiceAddress
*
from
,
gchar
*
buf
,
guint
len
);
gboolean
conn_check_handle_inbound_stun
(
NiceAgent
*
agent
,
Stream
*
stream
,
Component
*
component
,
NiceSocket
*
udp_socket
,
const
NiceAddress
*
from
,
gchar
*
buf
,
guint
len
);
gint
conn_check_compare
(
const
CandidateCheckPair
*
a
,
const
CandidateCheckPair
*
b
);
gint
conn_check_compare
(
const
CandidateCheckPair
*
a
,
const
CandidateCheckPair
*
b
);
void
conn_check_remote_candidates_set
(
NiceAgent
*
agent
);
void
conn_check_remote_candidates_set
(
NiceAgent
*
agent
);
NiceCandidateTransport
conn_check_match_transport
(
NiceCandidateTransport
transport
);
#endif
/*_NICE_CONNCHECK_H */
#endif
/*_NICE_CONNCHECK_H */
agent/discovery.c
View file @
b59c4bb5
...
@@ -763,20 +763,27 @@ NiceCandidate *discovery_learn_remote_peer_reflexive_candidate (
...
@@ -763,20 +763,27 @@ NiceCandidate *discovery_learn_remote_peer_reflexive_candidate (
Component
*
component
,
Component
*
component
,
guint32
priority
,
guint32
priority
,
const
NiceAddress
*
remote_address
,
const
NiceAddress
*
remote_address
,
NiceSocket
*
udp_socket
,
NiceSocket
*
nicesock
,
NiceCandidate
*
local
,
NiceCandidate
*
local
,
NiceCandidate
*
remote
)
NiceCandidate
*
remote
)
{
{
NiceCandidate
*
candidate
;
NiceCandidate
*
candidate
;
/* XXX: for use compiler */
(
void
)
udp_socket
;
candidate
=
nice_candidate_new
(
NICE_CANDIDATE_TYPE_PEER_REFLEXIVE
);
candidate
=
nice_candidate_new
(
NICE_CANDIDATE_TYPE_PEER_REFLEXIVE
);
candidate
->
addr
=
*
remote_address
;
candidate
->
addr
=
*
remote_address
;
candidate
->
base_addr
=
*
remote_address
;
candidate
->
base_addr
=
*
remote_address
;
if
(
remote
)
candidate
->
transport
=
remote
->
transport
;
candidate
->
transport
=
remote
->
transport
;
else
if
(
local
)
candidate
->
transport
=
conn_check_match_transport
(
local
->
transport
);
else
{
if
(
nicesock
->
type
==
NICE_SOCKET_TYPE_UDP_BSD
||
nicesock
->
type
==
NICE_SOCKET_TYPE_TURN
)
candidate
->
transport
=
NICE_CANDIDATE_TRANSPORT_UDP
;
else
candidate
->
transport
=
NICE_CANDIDATE_TRANSPORT_TCP_ACTIVE
;
}
candidate
->
stream_id
=
stream
->
id
;
candidate
->
stream_id
=
stream
->
id
;
candidate
->
component_id
=
component
->
id
;
candidate
->
component_id
=
component
->
id
;
...
...
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