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
pid_t pid = cli->getPid();
uid_t uid = cli->getUid();
pid_t pid = cli->getPid();
uid_t uid = cli->getUid();
+ netId = mNetCtrl->getNetwork(uid, netId, pid, true);
+
if (ai_flags != -1 || ai_family != -1 ||
ai_socktype != -1 || ai_protocol != -1) {
hints = (struct addrinfo*) calloc(1, sizeof(struct addrinfo));
if (ai_flags != -1 || ai_family != -1 ||
ai_socktype != -1 || ai_protocol != -1) {
hints = (struct addrinfo*) calloc(1, sizeof(struct addrinfo));
- netId = mNetCtrl->getNetwork(uid, netId, pid, true);
-
cli->incRef();
DnsProxyListener::GetAddrInfoHandler* handler =
new DnsProxyListener::GetAddrInfoHandler(cli, name, service, hints, netId);
cli->incRef();
DnsProxyListener::GetAddrInfoHandler* handler =
new DnsProxyListener::GetAddrInfoHandler(cli, name, service, hints, netId);
#include "NetworkController.h"
// Mark 1 is reserved for SecondaryTableController::PROTECT_MARK.
#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);
void NetworkController::clearNetworkPreference() {
android::RWLock::AutoWLock lock(mRWLock);