We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 8bb5618 + e83d181 commit eaeb4f4Copy full SHA for eaeb4f4
3 files changed
cmds/dumpstate/dumpstate.c
@@ -120,6 +120,12 @@ static void dumpstate() {
120
121
dump_file("NETWORK ROUTES", "/proc/net/route");
122
dump_file("NETWORK ROUTES IPV6", "/proc/net/ipv6_route");
123
+ run_command("IP RULES", 10, "ip", "rule", "show", NULL);
124
+ run_command("IP RULES v6", 10, "ip", "-6", "rule", "show", NULL);
125
+ run_command("ROUTE TABLE 60", 10, "ip", "route", "show", "table", "60", NULL);
126
+ run_command("ROUTE TABLE 61 v6", 10, "ip", "-6", "route", "show", "table", "60", NULL);
127
+ run_command("ROUTE TABLE 61", 10, "ip", "route", "show", "table", "61", NULL);
128
+ run_command("ROUTE TABLE 61 v6", 10, "ip", "-6", "route", "show", "table", "61", NULL);
129
dump_file("ARP CACHE", "/proc/net/arp");
130
run_command("IPTABLES", 10, "su", "root", "iptables", "-L", "-nvx", NULL);
131
run_command("IP6TABLES", 10, "su", "root", "ip6tables", "-L", "-nvx", NULL);
services/java/com/android/server/NetworkManagementService.java
@@ -856,13 +856,17 @@ private void modifyNat(String cmd, String internalInterface, String externalInte
856
857
NetworkInterface internalNetworkInterface =
858
NetworkInterface.getByName(internalInterface);
859
- Collection<InterfaceAddress>interfaceAddresses =
860
- internalNetworkInterface.getInterfaceAddresses();
861
- cmd += " " + interfaceAddresses.size();
862
- for (InterfaceAddress ia : interfaceAddresses) {
863
- InetAddress addr = NetworkUtils.getNetworkPart(ia.getAddress(),
864
- ia.getNetworkPrefixLength());
865
- cmd = cmd + " " + addr.getHostAddress() + "/" + ia.getNetworkPrefixLength();
+ if (internalNetworkInterface == null) {
+ cmd += " 0";
+ } else {
+ Collection<InterfaceAddress>interfaceAddresses =
+ internalNetworkInterface.getInterfaceAddresses();
+ cmd += " " + interfaceAddresses.size();
+ for (InterfaceAddress ia : interfaceAddresses) {
866
+ InetAddress addr = NetworkUtils.getNetworkPart(ia.getAddress(),
867
+ ia.getNetworkPrefixLength());
868
+ cmd = cmd + " " + addr.getHostAddress() + "/" + ia.getNetworkPrefixLength();
869
+ }
870
}
871
872
mConnector.doCommand(cmd);
telephony/java/com/android/internal/telephony/DataCallState.java
@@ -126,6 +126,8 @@ public SetupResult setLinkProperties(LinkProperties linkProperties,
// set link addresses
if (addresses != null && addresses.length > 0) {
for (String addr : addresses) {
+ addr = addr.trim();
+ if (addr.isEmpty()) continue;
LinkAddress la;
132
int addrPrefixLen;
133
@@ -159,6 +161,8 @@ public SetupResult setLinkProperties(LinkProperties linkProperties,
159
161
// set dns servers
160
162
if (dnses != null && dnses.length > 0) {
163
for (String addr : dnses) {
164
165
166
InetAddress ia;
167
try {
168
ia = NetworkUtils.numericToInetAddress(addr);
@@ -174,6 +178,8 @@ public SetupResult setLinkProperties(LinkProperties linkProperties,
174
178
dnsServers[0] = SystemProperties.get(propertyPrefix + "dns1");
175
179
dnsServers[1] = SystemProperties.get(propertyPrefix + "dns2");
176
180
for (String dnsAddr : dnsServers) {
181
+ dnsAddr = dnsAddr.trim();
182
+ if (dnsAddr.isEmpty()) continue;
177
183
184
185
ia = NetworkUtils.numericToInetAddress(dnsAddr);
@@ -198,6 +204,8 @@ public SetupResult setLinkProperties(LinkProperties linkProperties,
198
204
199
205
200
206
for (String addr : gateways) {
207
208
201
209
202
210
203
211
0 commit comments