summaryrefslogtreecommitdiffstats
path: root/cmds/dumpstate
diff options
context:
space:
mode:
authorLorenzo Colitti <lorenzo@google.com>2014-07-30 14:38:20 +0900
committerLorenzo Colitti <lorenzo@google.com>2014-07-31 01:56:12 +0000
commitd4c3d38957870fa27423dbc55d99d68772fbd490 (patch)
tree3133fa1b242ddcaa022b83987263b07caabae8b9 /cmds/dumpstate
parent9ae79d869a37633fa956a4f16f3fa45b23c189f1 (diff)
downloadframeworks_native-d4c3d38957870fa27423dbc55d99d68772fbd490.zip
frameworks_native-d4c3d38957870fa27423dbc55d99d68772fbd490.tar.gz
frameworks_native-d4c3d38957870fa27423dbc55d99d68772fbd490.tar.bz2
Improve network connectivity dumping.
1. Explicitly dump IP addresses. Currently, some IP addresses are dumped using netcfg, but that only dumps the first IPv4 address on each interface. Instead, call ip -4 addr and ip -6 addr explicitly to dump all IPv4 and IPv6 addresses on the system. 2. Disable dumping /proc/net/{ipv6,}route, because: - We already dump all IPv4 and IPv6 routes in the tables that we use. - /proc/net/route is confusing because it only includes routes in the main table, which are all but unused. It's also in unreadable host-byte-order hex. - /proc/net/ipv6_route is confusing because it includes routes from all tables but does not say what table they are in. 3. Instead of dumping the contents of /proc/net/arp , use "ip -4 neigh show" and "ip -6 neigh show" to dump the neighbour caches for both IPv4 and IPv6. Bug: 16663736 Change-Id: Id3e509b877ab7b00eb2399b6a9868b12245da2f0
Diffstat (limited to 'cmds/dumpstate')
-rw-r--r--cmds/dumpstate/dumpstate.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/cmds/dumpstate/dumpstate.c b/cmds/dumpstate/dumpstate.c
index d2f99df..342dc89 100644
--- a/cmds/dumpstate/dumpstate.c
+++ b/cmds/dumpstate/dumpstate.c
@@ -205,9 +205,6 @@ static void dumpstate() {
dump_file("QTAGUID CTRL INFO", "/proc/net/xt_qtaguid/ctrl");
dump_file("QTAGUID STATS INFO", "/proc/net/xt_qtaguid/stats");
- dump_file("NETWORK ROUTES", "/proc/net/route");
- dump_file("NETWORK ROUTES IPV6", "/proc/net/ipv6_route");
-
if (!stat(PSTORE_LAST_KMSG, &st)) {
/* Also TODO: Make console-ramoops CAP_SYSLOG protected. */
dump_file("LAST KMSG", PSTORE_LAST_KMSG);
@@ -223,12 +220,18 @@ static void dumpstate() {
/* The following have a tendency to get wedged when wifi drivers/fw goes belly-up. */
run_command("NETWORK INTERFACES", 10, SU_PATH, "root", "netcfg", NULL);
+
+ run_command("IPv4 ADDRESSES", 10, "ip", "-4", "addr", "show", NULL);
+ run_command("IPv6 ADDRESSES", 10, "ip", "-6", "addr", "show", NULL);
+
run_command("IP RULES", 10, "ip", "rule", "show", NULL);
run_command("IP RULES v6", 10, "ip", "-6", "rule", "show", NULL);
dump_route_tables();
- dump_file("ARP CACHE", "/proc/net/arp");
+ run_command("ARP CACHE", 10, "ip", "-4", "neigh", "show", NULL);
+ run_command("IPv6 ND CACHE", 10, "ip", "-6", "neigh", "show", NULL);
+
run_command("IPTABLES", 10, SU_PATH, "root", "iptables", "-L", "-nvx", NULL);
run_command("IP6TABLES", 10, SU_PATH, "root", "ip6tables", "-L", "-nvx", NULL);
run_command("IPTABLE NAT", 10, SU_PATH, "root", "iptables", "-t", "nat", "-L", "-nvx", NULL);