resolved conflicts for merge of 41394a36 to honeycomb-plus-aosp

Change-Id: If4dc99c558dc45c9a7ff8d3ea5be69578b4ee793
This commit is contained in:
Robert Greenwalt
2011-07-26 15:26:02 -07:00
5 changed files with 39 additions and 27 deletions

View File

@@ -113,8 +113,8 @@ static void dumpstate() {
dump_file("NETWORK ROUTES", "/proc/net/route");
dump_file("NETWORK ROUTES IPV6", "/proc/net/ipv6_route");
dump_file("ARP CACHE", "/proc/net/arp");
run_command("IPTABLES", 10, "su", "root", "iptables", "-L", NULL);
run_command("IPTABLE NAT", 10, "su", "root", "iptables", "-t", "nat", "-L", NULL);
run_command("IPTABLES", 10, "su", "root", "iptables", "-L", "-n", NULL);
run_command("IPTABLE NAT", 10, "su", "root", "iptables", "-t", "nat", "-L", "-n", NULL);
run_command("WIFI NETWORKS", 20,
"su", "root", "wpa_cli", "list_networks", NULL);

View File

@@ -252,12 +252,12 @@ interface INetworkManagementService
void setDnsServersForInterface(String iface, in String[] servers);
/**
* Flush the DNS cache associated with the default interface
* Flush the DNS cache associated with the default interface.
*/
void flushDefaultDnsCache();
/**
* Flush the DNS cache associated with the specified interface
* Flush the DNS cache associated with the specified interface.
*/
void flushInterfaceDnsCache(String iface);
}

View File

@@ -1985,6 +1985,12 @@ public class ConnectivityService extends IConnectivityManager.Stub {
LinkProperties p = nt.getLinkProperties();
if (p == null) return;
Collection<InetAddress> dnses = p.getDnses();
try {
mNetd.setDnsServersForInterface(p.getInterfaceName(),
NetworkUtils.makeStrings(dnses));
} catch (Exception e) {
Slog.e(TAG, "exception setting dns servers: " + e);
}
boolean changed = false;
if (mNetConfigs[netType].isDefault()) {
String network = nt.getNetworkInfo().getTypeName();

View File

@@ -1375,18 +1375,17 @@ class NetworkManagementService extends INetworkManagementService.Stub {
try {
String cmd = "resolver setifdns " + iface;
for (String s : servers) {
if (s != null && !"0.0.0.0".equals(s) &&
!"::".equals(s) && !"0:0:0:0:0:0:0:0".equals(s)) {
cmd += " " + InetAddress.getByName(s).getHostAddress();
InetAddress a = NetworkUtils.numericToInetAddress(s);
if (a.isAnyLocalAddress() == false) {
cmd += " " + a.getHostAddress();
}
}
mConnector.doCommand(cmd);
} catch (UnknownHostException e) {
throw new IllegalStateException("failed to resolve dns address.", e);
} catch (IllegalArgumentException e) {
throw new IllegalStateException("Error setting dnsn for interface", e);
} catch (NativeDaemonConnectorException e) {
throw new IllegalStateException(
"Error communicating with native deamon to set dns for interface", e);
"Error communicating with native daemon to set dns for interface", e);
}
}
@@ -1412,7 +1411,7 @@ class NetworkManagementService extends INetworkManagementService.Stub {
mConnector.doCommand(cmd);
} catch (NativeDaemonConnectorException e) {
throw new IllegalStateException(
"Error communicating with native deamon to flush interface " + iface, e);
"Error communicating with native daemon to flush interface " + iface, e);
}
}
}

View File

@@ -142,13 +142,15 @@ public class DataCallState {
} catch (IllegalArgumentException e) {
throw new UnknownHostException("Non-numeric ip addr=" + addr);
}
if (addrPrefixLen == 0) {
// Assume point to point
addrPrefixLen = (ia instanceof Inet4Address) ? 32 : 128;
if (! ia.isAnyLocalAddress()) {
if (addrPrefixLen == 0) {
// Assume point to point
addrPrefixLen = (ia instanceof Inet4Address) ? 32 : 128;
}
if (DBG) Log.d(LOG_TAG, "addr/pl=" + addr + "/" + addrPrefixLen);
la = new LinkAddress(ia, addrPrefixLen);
linkProperties.addLinkAddress(la);
}
if (DBG) Log.d(LOG_TAG, "addr/pl=" + addr + "/" + addrPrefixLen);
la = new LinkAddress(ia, addrPrefixLen);
linkProperties.addLinkAddress(la);
}
} else {
throw new UnknownHostException("no address for ifname=" + ifname);
@@ -163,21 +165,24 @@ public class DataCallState {
} catch (IllegalArgumentException e) {
throw new UnknownHostException("Non-numeric dns addr=" + addr);
}
linkProperties.addDns(ia);
if (! ia.isAnyLocalAddress()) {
linkProperties.addDns(ia);
}
}
} else if (okToUseSystemPropertyDns){
String dnsServers[] = new String[2];
dnsServers[0] = SystemProperties.get(propertyPrefix + "dns1");
dnsServers[1] = SystemProperties.get(propertyPrefix + "dns2");
for (String dnsAddr : dnsServers) {
InetAddress ia;
try {
ia = NetworkUtils.numericToInetAddress(dnsAddr);
} catch (IllegalArgumentException e) {
throw new UnknownHostException("Non-numeric dns addr="
+ dnsAddr);
}
InetAddress ia;
try {
ia = NetworkUtils.numericToInetAddress(dnsAddr);
} catch (IllegalArgumentException e) {
throw new UnknownHostException("Non-numeric dns addr=" + dnsAddr);
}
if (! ia.isAnyLocalAddress()) {
linkProperties.addDns(ia);
}
}
} else {
throw new UnknownHostException("Empty dns response and no system default dns");
@@ -199,7 +204,9 @@ public class DataCallState {
} catch (IllegalArgumentException e) {
throw new UnknownHostException("Non-numeric gateway addr=" + addr);
}
linkProperties.addRoute(new RouteInfo(ia));
if (! ia.isAnyLocalAddress()) {
linkProperties.addRoute(new RouteInfo(ia));
}
}
result = SetupResult.SUCCESS;