Merge "Avoid system_server crashing due to mac address is null"
This commit is contained in:
@@ -53,10 +53,12 @@ public class ArpPeer {
|
|||||||
mInterfaceName = interfaceName;
|
mInterfaceName = interfaceName;
|
||||||
mMyAddr = myAddr;
|
mMyAddr = myAddr;
|
||||||
|
|
||||||
|
if (mac != null) {
|
||||||
for (int i = 0; i < MAC_ADDR_LENGTH; i++) {
|
for (int i = 0; i < MAC_ADDR_LENGTH; i++) {
|
||||||
mMyMac[i] = (byte) Integer.parseInt(mac.substring(
|
mMyMac[i] = (byte) Integer.parseInt(mac.substring(
|
||||||
i*3, (i*3) + 2), 16);
|
i*3, (i*3) + 2), 16);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (myAddr instanceof Inet6Address || peer instanceof Inet6Address) {
|
if (myAddr instanceof Inet6Address || peer instanceof Inet6Address) {
|
||||||
throw new IllegalArgumentException("IPv6 unsupported");
|
throw new IllegalArgumentException("IPv6 unsupported");
|
||||||
|
|||||||
Reference in New Issue
Block a user