summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobert Greenwalt <rgreenwalt@google.com>2011-11-23 11:25:39 -0800
committerAndroid (Google) Code Review <android-gerrit@google.com>2011-11-23 11:25:39 -0800
commiteaeb4f4e3c914550d28a042fb3d752efcf20ab9e (patch)
tree24b933974484d6fe2e1b755ef7fd7e43ac44b7c1
parent8bb56180d208b9264e5a56b49fe06b8471ccaced (diff)
parente83d181606981bcacd78e55b293fe9fa95b2551d (diff)
downloadframeworks_base-eaeb4f4e3c914550d28a042fb3d752efcf20ab9e.zip
frameworks_base-eaeb4f4e3c914550d28a042fb3d752efcf20ab9e.tar.gz
frameworks_base-eaeb4f4e3c914550d28a042fb3d752efcf20ab9e.tar.bz2
Merge "Fix some policy-base routing issues." into ics-mr1
-rw-r--r--cmds/dumpstate/dumpstate.c6
-rw-r--r--services/java/com/android/server/NetworkManagementService.java18
-rw-r--r--telephony/java/com/android/internal/telephony/DataCallState.java8
3 files changed, 25 insertions, 7 deletions
diff --git a/cmds/dumpstate/dumpstate.c b/cmds/dumpstate/dumpstate.c
index fe81d2b..395c28b 100644
--- a/cmds/dumpstate/dumpstate.c
+++ b/cmds/dumpstate/dumpstate.c
@@ -120,6 +120,12 @@ static void dumpstate() {
dump_file("NETWORK ROUTES", "/proc/net/route");
dump_file("NETWORK ROUTES IPV6", "/proc/net/ipv6_route");
+ run_command("IP RULES", 10, "ip", "rule", "show", NULL);
+ run_command("IP RULES v6", 10, "ip", "-6", "rule", "show", NULL);
+ run_command("ROUTE TABLE 60", 10, "ip", "route", "show", "table", "60", NULL);
+ run_command("ROUTE TABLE 61 v6", 10, "ip", "-6", "route", "show", "table", "60", NULL);
+ run_command("ROUTE TABLE 61", 10, "ip", "route", "show", "table", "61", NULL);
+ run_command("ROUTE TABLE 61 v6", 10, "ip", "-6", "route", "show", "table", "61", NULL);
dump_file("ARP CACHE", "/proc/net/arp");
run_command("IPTABLES", 10, "su", "root", "iptables", "-L", "-nvx", NULL);
run_command("IP6TABLES", 10, "su", "root", "ip6tables", "-L", "-nvx", NULL);
diff --git a/services/java/com/android/server/NetworkManagementService.java b/services/java/com/android/server/NetworkManagementService.java
index da960ae..75e5366 100644
--- a/services/java/com/android/server/NetworkManagementService.java
+++ b/services/java/com/android/server/NetworkManagementService.java
@@ -856,13 +856,17 @@ public class NetworkManagementService extends INetworkManagementService.Stub
NetworkInterface internalNetworkInterface =
NetworkInterface.getByName(internalInterface);
- Collection<InterfaceAddress>interfaceAddresses =
- internalNetworkInterface.getInterfaceAddresses();
- cmd += " " + interfaceAddresses.size();
- for (InterfaceAddress ia : interfaceAddresses) {
- InetAddress addr = NetworkUtils.getNetworkPart(ia.getAddress(),
- ia.getNetworkPrefixLength());
- cmd = cmd + " " + addr.getHostAddress() + "/" + ia.getNetworkPrefixLength();
+ if (internalNetworkInterface == null) {
+ cmd += " 0";
+ } else {
+ Collection<InterfaceAddress>interfaceAddresses =
+ internalNetworkInterface.getInterfaceAddresses();
+ cmd += " " + interfaceAddresses.size();
+ for (InterfaceAddress ia : interfaceAddresses) {
+ InetAddress addr = NetworkUtils.getNetworkPart(ia.getAddress(),
+ ia.getNetworkPrefixLength());
+ cmd = cmd + " " + addr.getHostAddress() + "/" + ia.getNetworkPrefixLength();
+ }
}
mConnector.doCommand(cmd);
diff --git a/telephony/java/com/android/internal/telephony/DataCallState.java b/telephony/java/com/android/internal/telephony/DataCallState.java
index 6d8956f..efbf608 100644
--- a/telephony/java/com/android/internal/telephony/DataCallState.java
+++ b/telephony/java/com/android/internal/telephony/DataCallState.java
@@ -126,6 +126,8 @@ public class DataCallState {
// set link addresses
if (addresses != null && addresses.length > 0) {
for (String addr : addresses) {
+ addr = addr.trim();
+ if (addr.isEmpty()) continue;
LinkAddress la;
int addrPrefixLen;
@@ -159,6 +161,8 @@ public class DataCallState {
// set dns servers
if (dnses != null && dnses.length > 0) {
for (String addr : dnses) {
+ addr = addr.trim();
+ if (addr.isEmpty()) continue;
InetAddress ia;
try {
ia = NetworkUtils.numericToInetAddress(addr);
@@ -174,6 +178,8 @@ public class DataCallState {
dnsServers[0] = SystemProperties.get(propertyPrefix + "dns1");
dnsServers[1] = SystemProperties.get(propertyPrefix + "dns2");
for (String dnsAddr : dnsServers) {
+ dnsAddr = dnsAddr.trim();
+ if (dnsAddr.isEmpty()) continue;
InetAddress ia;
try {
ia = NetworkUtils.numericToInetAddress(dnsAddr);
@@ -198,6 +204,8 @@ public class DataCallState {
}
}
for (String addr : gateways) {
+ addr = addr.trim();
+ if (addr.isEmpty()) continue;
InetAddress ia;
try {
ia = NetworkUtils.numericToInetAddress(addr);