agent: Use provided CandidatePair rather than re-finding a pair
authorPhilip Withnall <philip.withnall@collabora.co.uk>
Tue, 1 Mar 2016 23:23:14 +0000 (23:23 +0000)
committerPhilip Withnall <philip@tecnocode.co.uk>
Tue, 1 Mar 2016 23:23:57 +0000 (23:23 +0000)
commit38c5e66886cb8138d6be57b8a4721d9b42a358b7
tree97f54bf9aa948469b4178b8bec683f01935f779a
parent70981d41edf46a09393017f3de34748fcecea046
agent: Use provided CandidatePair rather than re-finding a pair

In priv_update_selected_pair(), commit 57393333 changed the code to
re-find a CandidatePair matching the given lfoundation and rfoundation.
However, the foundation does not uniquely identify candidate pairs,
and if we’re aiming to set a specific candidate pair as the selected
pair, this could result in the wrong pair being selected.

This can happen when handling multiple similar candidate pairs, such as
when generating peer reflexive candidates from multiple sources.

See https://tools.ietf.org/html/rfc5245#section-2.4.

Originally spotted by Fabrice Bellet in
https://phabricator.freedesktop.org/T3557.

Reviewed-by: José Antonio Santos Cadenas <santoscadenas@gmail.com>
Differential Revision: https://phabricator.freedesktop.org/D742
agent/conncheck.c