fix bad return value in dhcp_do_request_*
1. bad return status make it return uninitialized prefixLength with a magic number in android_net_utils_runDhcpCommon() 2. it will make DhcpInfoInternal.makeLinkAddress() to throw IllegalArgumentException when try to connect a Wifi AP 3. the exception will make system reboot, of cource it random. Change-Id: Iabc0cd5b69c1316f4eeae0aa1b8a91444dca4562 Signed-off-by: Michael Wu <michaelstay@gmail.com>
This commit is contained in:
parent
59fa7e107d
commit
897df50f4c
|
@ -367,9 +367,8 @@ int dhcp_do_request_renew(const char *interface,
|
|||
return -1;
|
||||
}
|
||||
if (strcmp(prop_value, "ok") == 0) {
|
||||
fill_ip_info(interface, ipaddr, gateway, prefixLength,
|
||||
return fill_ip_info(interface, ipaddr, gateway, prefixLength,
|
||||
dns1, dns2, server, lease, vendorInfo);
|
||||
return 0;
|
||||
} else {
|
||||
snprintf(errmsg, sizeof(errmsg), "DHCP Renew result was %s", prop_value);
|
||||
return -1;
|
||||
|
|
Loading…
Reference in New Issue