Bug 1245059 - Disable NotifyIpInterfaceChange use for now. r=mcmanus
☠☠ backed out by e0b052f1f5cd ☠ ☠
authorDaniel Stenberg <daniel@haxx.se>
Fri, 18 Mar 2016 05:29:00 -0400
changeset 289418 cbceb4f4ec73a560ade80ff920229621c2851104
parent 289417 9c6650c7e237b5f8473963565f7b6250cfe96a7a
child 289419 e41e3bc842dfda1b70080688f93de86ebe651790
push id30102
push userryanvm@gmail.com
push dateSat, 19 Mar 2016 15:23:17 +0000
treeherdermozilla-central@720fb3d55e28 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmcmanus
bugs1245059
milestone48.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1245059 - Disable NotifyIpInterfaceChange use for now. r=mcmanus
modules/libpref/init/all.js
netwerk/system/win32/nsNotifyAddrListener.cpp
netwerk/system/win32/nsNotifyAddrListener.h
--- a/modules/libpref/init/all.js
+++ b/modules/libpref/init/all.js
@@ -1225,16 +1225,23 @@ pref("security.fileuri.strict_origin_pol
 // telemetry is also enabled as otherwise there is no way to report
 // the results
 pref("network.allow-experiments", true);
 
 // Allow the network changed event to get sent when a network topology or
 // setup change is noticed while running.
 pref("network.notify.changed", true);
 
+// Allow network detection of IPv6 related changes (bug 1245059)
+#if defined(XP_WIN)
+pref("network.notify.IPv6", false);
+else
+pref("network.notify.IPv6", true);
+#endif
+
 // Transmit UDP busy-work to the LAN when anticipating low latency
 // network reads and on wifi to mitigate 802.11 Power Save Polling delays
 pref("network.tickle-wifi.enabled", false);
 pref("network.tickle-wifi.duration", 400);
 pref("network.tickle-wifi.delay", 16);
 
 // Turn off interprocess security checks. Needed to run xpcshell tests.
 pref("network.disable.ipc.security", false);
--- a/netwerk/system/win32/nsNotifyAddrListener.cpp
+++ b/netwerk/system/win32/nsNotifyAddrListener.cpp
@@ -41,16 +41,17 @@ static LazyLogModule gNotifyAddrLog("nsN
 static HMODULE sNetshell;
 static decltype(NcFreeNetconProperties)* sNcFreeNetconProperties;
 
 static HMODULE sIphlpapi;
 static decltype(NotifyIpInterfaceChange)* sNotifyIpInterfaceChange;
 static decltype(CancelMibChangeNotify2)* sCancelMibChangeNotify2;
 
 #define NETWORK_NOTIFY_CHANGED_PREF "network.notify.changed"
+#define NETWORK_NOTIFY_IPV6_PREF "network.notify.IPv6"
 
 // period during which to absorb subsequent network change events, in
 // milliseconds
 static const unsigned int kNetworkChangeCoalescingPeriod  = 1000;
 
 static void InitIphlpapi(void)
 {
     if (!sIphlpapi) {
@@ -101,16 +102,17 @@ NS_IMPL_ISUPPORTS(nsNotifyAddrListener,
 nsNotifyAddrListener::nsNotifyAddrListener()
     : mLinkUp(true)  // assume true by default
     , mStatusKnown(false)
     , mCheckAttempted(false)
     , mCheckEvent(nullptr)
     , mShutdown(false)
     , mIPInterfaceChecksum(0)
     , mAllowChangedEvent(true)
+    , mIPv6Changes(false)
     , mCoalescingActive(false)
 {
     InitIphlpapi();
 }
 
 nsNotifyAddrListener::~nsNotifyAddrListener()
 {
     NS_ASSERTION(!mThread, "nsNotifyAddrListener thread shutdown failed");
@@ -175,17 +177,17 @@ NS_IMETHODIMP
 nsNotifyAddrListener::Run()
 {
     PR_SetCurrentThreadName("Link Monitor");
 
     mStartTime = TimeStamp::Now();
 
     DWORD waitTime = INFINITE;
 
-    if (!sNotifyIpInterfaceChange || !sCancelMibChangeNotify2) {
+    if (!sNotifyIpInterfaceChange || !sCancelMibChangeNotify2 || !mIPv6Changes) {
         // For Windows versions which are older than Vista which lack
         // NotifyIpInterfaceChange. Note this means no IPv6 support.
         HANDLE ev = CreateEvent(nullptr, FALSE, FALSE, nullptr);
         NS_ENSURE_TRUE(ev, NS_ERROR_OUT_OF_MEMORY);
 
         HANDLE handles[2] = { ev, mCheckEvent };
         OVERLAPPED overlapped = { 0 };
         bool shuttingDown = false;
@@ -259,16 +261,18 @@ nsNotifyAddrListener::Init(void)
         return NS_ERROR_FAILURE;
 
     nsresult rv = observerService->AddObserver(this, "xpcom-shutdown-threads",
                                                false);
     NS_ENSURE_SUCCESS(rv, rv);
 
     Preferences::AddBoolVarCache(&mAllowChangedEvent,
                                  NETWORK_NOTIFY_CHANGED_PREF, true);
+    Preferences::AddBoolVarCache(&mIPv6Changes,
+                                 NETWORK_NOTIFY_IPV6_PREF, false);
 
     mCheckEvent = CreateEvent(nullptr, FALSE, FALSE, nullptr);
     NS_ENSURE_TRUE(mCheckEvent, NS_ERROR_OUT_OF_MEMORY);
 
     rv = NS_NewThread(getter_AddRefs(mThread), this);
     NS_ENSURE_SUCCESS(rv, rv);
 
     return NS_OK;
--- a/netwerk/system/win32/nsNotifyAddrListener.h
+++ b/netwerk/system/win32/nsNotifyAddrListener.h
@@ -77,16 +77,19 @@ private:
     ULONG mIPInterfaceChecksum;
 
     // start time of the checking
     mozilla::TimeStamp mStartTime;
 
     // Network changed events are enabled
     bool mAllowChangedEvent;
 
+    // Check for IPv6 network changes
+    bool mIPv6Changes;
+
     // Flag set while coalescing change events
     bool mCoalescingActive;
 
     // Time stamp for first event during coalescing
     mozilla::TimeStamp mChangeTime;
 };
 
 #endif /* NSNOTIFYADDRLISTENER_H_ */