Fix for DNS resolutions when there is no default network set yet.
We need to determine the actual netId to use prior to comparing
it against the default netId. Also initialize the default network
variable.
bug:13877665
Change-Id: I24c05eb006e2c93d5e0a9b94fee4da408089d2b8
diff --git a/NetworkController.cpp b/NetworkController.cpp
index 398adb0..937347b 100644
--- a/NetworkController.cpp
+++ b/NetworkController.cpp
@@ -22,7 +22,9 @@
#include "NetworkController.h"
// Mark 1 is reserved for SecondaryTableController::PROTECT_MARK.
-NetworkController::NetworkController() : mNextFreeNetId(10) {}
+NetworkController::NetworkController()
+ : mDefaultNetId(NETID_UNSET),
+ mNextFreeNetId(10) {}
void NetworkController::clearNetworkPreference() {
android::RWLock::AutoWLock lock(mRWLock);