diff options
Diffstat (limited to 'services/java/com/android/server/NetworkManagementService.java')
-rw-r--r-- | services/java/com/android/server/NetworkManagementService.java | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/services/java/com/android/server/NetworkManagementService.java b/services/java/com/android/server/NetworkManagementService.java index b58ba73..9d808e1 100644 --- a/services/java/com/android/server/NetworkManagementService.java +++ b/services/java/com/android/server/NetworkManagementService.java @@ -862,13 +862,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); |