summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobert Greenwalt <rgreenwalt@google.com>2011-07-26 15:26:02 -0700
committerRobert Greenwalt <rgreenwalt@google.com>2011-07-26 15:26:02 -0700
commit22d93a0d71d965970f581cd9aa1cbf2efbb5998f (patch)
treef5b0d0a82c59d398fe2185ac047f532fba71724d
parentbce8effe75c5477eb42d4e1c4df609da962285a2 (diff)
parent41394a361020e9f58524f23d6831bb8e63063856 (diff)
downloadframeworks_base-22d93a0d71d965970f581cd9aa1cbf2efbb5998f.zip
frameworks_base-22d93a0d71d965970f581cd9aa1cbf2efbb5998f.tar.gz
frameworks_base-22d93a0d71d965970f581cd9aa1cbf2efbb5998f.tar.bz2
resolved conflicts for merge of 41394a36 to honeycomb-plus-aosp
Change-Id: If4dc99c558dc45c9a7ff8d3ea5be69578b4ee793
-rw-r--r--cmds/dumpstate/dumpstate.c4
-rw-r--r--core/java/android/os/INetworkManagementService.aidl4
-rw-r--r--services/java/com/android/server/ConnectivityService.java6
-rw-r--r--services/java/com/android/server/NetworkManagementService.java15
-rw-r--r--telephony/java/com/android/internal/telephony/DataCallState.java37
5 files changed, 39 insertions, 27 deletions
diff --git a/cmds/dumpstate/dumpstate.c b/cmds/dumpstate/dumpstate.c
index 4926db2..52b2d91 100644
--- a/cmds/dumpstate/dumpstate.c
+++ b/cmds/dumpstate/dumpstate.c
@@ -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);
diff --git a/core/java/android/os/INetworkManagementService.aidl b/core/java/android/os/INetworkManagementService.aidl
index 1174e3b..03a6c07 100644
--- a/core/java/android/os/INetworkManagementService.aidl
+++ b/core/java/android/os/INetworkManagementService.aidl
@@ -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);
}
diff --git a/services/java/com/android/server/ConnectivityService.java b/services/java/com/android/server/ConnectivityService.java
index 0843948..8a21f4f 100644
--- a/services/java/com/android/server/ConnectivityService.java
+++ b/services/java/com/android/server/ConnectivityService.java
@@ -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();
diff --git a/services/java/com/android/server/NetworkManagementService.java b/services/java/com/android/server/NetworkManagementService.java
index 17ad268..a16f748 100644
--- a/services/java/com/android/server/NetworkManagementService.java
+++ b/services/java/com/android/server/NetworkManagementService.java
@@ -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);
}
}
}
diff --git a/telephony/java/com/android/internal/telephony/DataCallState.java b/telephony/java/com/android/internal/telephony/DataCallState.java
index a69ce8b..6d8956f 100644
--- a/telephony/java/com/android/internal/telephony/DataCallState.java
+++ b/telephony/java/com/android/internal/telephony/DataCallState.java
@@ -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;