Index: webrtc/p2p/base/p2ptransportchannel.cc |
diff --git a/webrtc/p2p/base/p2ptransportchannel.cc b/webrtc/p2p/base/p2ptransportchannel.cc |
index 46ed40ad76f9ced65929339594e5757ae435bb32..cd3aff1bec3b10d5ba6d575f52d72cb8363006dc 100644 |
--- a/webrtc/p2p/base/p2ptransportchannel.cc |
+++ b/webrtc/p2p/base/p2ptransportchannel.cc |
@@ -666,6 +666,15 @@ void P2PTransportChannel::OnUseCandidate(Connection* conn) { |
void P2PTransportChannel::OnCandidate(const Candidate& candidate) { |
ASSERT(worker_thread_ == rtc::Thread::Current()); |
+ uint32 generation = candidate.generation(); |
+ if (generation != 0 && generation < remote_candidate_generation_) { |
+ LOG(LS_WARNING) << "Dropping a remote candidate because its generation " |
+ << generation |
+ << " is lower than the current remote generation " |
+ << remote_candidate_generation_; |
+ return; |
+ } |
+ |
// Create connections to this remote candidate. |
CreateConnections(candidate, NULL, false); |