summaryrefslogtreecommitdiff
path: root/pjnath
diff options
context:
space:
mode:
authorBenny Prijono <bennylp@teluu.com>2009-08-20 22:42:29 +0000
committerBenny Prijono <bennylp@teluu.com>2009-08-20 22:42:29 +0000
commitecf593ab1b9006b5d0f3b0bd0c17eb69626095c9 (patch)
tree619bd08bfca78d3d07e144ca3d52591686d3d7ab /pjnath
parentf9f392a5107ce77f162db5855dc68103eff93bd9 (diff)
Fixed ticket #953: ICE may find the wrong best candidate (thanks John Ridges for the report)
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@2905 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjnath')
-rw-r--r--pjnath/src/pjnath/ice_session.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/pjnath/src/pjnath/ice_session.c b/pjnath/src/pjnath/ice_session.c
index 841c74b0..d725b9b0 100644
--- a/pjnath/src/pjnath/ice_session.c
+++ b/pjnath/src/pjnath/ice_session.c
@@ -2313,12 +2313,14 @@ static void on_stun_request_complete(pj_stun_session *stun_sess,
ice->valid_list.checks[i].nominated = check->nominated;
}
- /* Sort valid_list */
- sort_checklist(&ice->valid_list);
-
/* Update valid check and nominated check for the component */
update_comp_check(ice, new_check->lcand->comp_id, new_check);
+ /* Sort valid_list (must do so after update_comp_check(), otherwise
+ * new_check will point to something else (#953)
+ */
+ sort_checklist(&ice->valid_list);
+
/* 7.1.2.2.2. Updating Pair States
*
* The agent sets the state of the pair that generated the check to