Handle empty gateways

Change-Id: Icbc1859125bae0bc222685bfbc18af38273d6827
This commit is contained in:
Irfan Sheriff 2012-12-07 10:36:29 -08:00
parent 35c625194b
commit 94cecfc4a0

View file

@ -112,7 +112,7 @@ static int fill_ip_info(const char *interface,
property_get(prop_name, server, NULL);
//TODO: Handle IPv6 when we change system property usage
if (strcmp(gateway, "0.0.0.0") == 0) {
if (gateway[0] == '\0' || strncmp(gateway, "0.0.0.0", 7) == 0) {
//DHCP server is our best bet as gateway
strncpy(gateway, server, PROPERTY_VALUE_MAX);
}