Index: chrome/browser/media/router/discovery/dial/dial_device_data.cc |
diff --git a/chrome/browser/media/router/discovery/dial/dial_device_data.cc b/chrome/browser/media/router/discovery/dial/dial_device_data.cc |
index c130b834a586cbc3eb188a860a7174748dde1764..56ca2136da8726a50822cc014ab63fed1850e465 100644 |
--- a/chrome/browser/media/router/discovery/dial/dial_device_data.cc |
+++ b/chrome/browser/media/router/discovery/dial/dial_device_data.cc |
@@ -3,6 +3,7 @@ |
// found in the LICENSE file. |
#include "chrome/browser/media/router/discovery/dial/dial_device_data.h" |
+#include "net/base/ip_address.h" |
namespace media_router { |
@@ -31,7 +32,16 @@ void DialDeviceData::set_device_description_url(const GURL& url) { |
// static |
bool DialDeviceData::IsDeviceDescriptionUrl(const GURL& url) { |
- return url.is_valid() && !url.is_empty() && url.SchemeIsHTTPOrHTTPS(); |
+ if (!url.is_valid() || url.is_empty() || !url.SchemeIsHTTPOrHTTPS()) |
+ return false; |
+ |
+ net::IPAddress address; |
+ if (!net::ParseURLHostnameToAddress(url.host(), &address)) |
+ return false; |
+ |
+ // TODO(crbug.com/679432): check that this IP address matches the address that |
+ // we received the SSDP advertisement from. |
+ return address.IsReserved(); |
} |
bool DialDeviceData::UpdateFrom(const DialDeviceData& new_data) { |