diff --git a/libnetutils/dhcp_utils.c b/libnetutils/dhcp_utils.c index a22096781..a59de0d5a 100644 --- a/libnetutils/dhcp_utils.c +++ b/libnetutils/dhcp_utils.c @@ -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); }