Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(79)

Unified Diff: content/browser/renderer_host/p2p/socket_host_udp.cc

Issue 7529039: Properly handle STUN requests and responses from relay servers. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: - Created 9 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/browser/renderer_host/p2p/socket_host_udp.cc
diff --git a/content/browser/renderer_host/p2p/socket_host_udp.cc b/content/browser/renderer_host/p2p/socket_host_udp.cc
index 8fae6ff10ef48c38182a4fb222251b3ed525d23b..a606ebcb0ea8d436fc002a4cd0a5e7d6d22e8847 100644
--- a/content/browser/renderer_host/p2p/socket_host_udp.cc
+++ b/content/browser/renderer_host/p2p/socket_host_udp.cc
@@ -100,8 +100,7 @@ void P2PSocketHostUdp::DidCompleteRead(int result) {
if (authorized_peers_.find(recv_address_) == authorized_peers_.end()) {
P2PSocketHost::StunMessageType type;
bool stun = GetStunPacketType(&*data.begin(), data.size(), &type);
- if (stun && (type == STUN_BINDING_REQUEST ||
- type == STUN_BINDING_RESPONSE)) {
+ if (stun && IsRequestOrResponse(type)) {
authorized_peers_.insert(recv_address_);
} else if (!stun || type == STUN_DATA_INDICATION) {
LOG(ERROR) << "Received unexpected data packet from "

Powered by Google App Engine
This is Rietveld 408576698