resolved conflicts for merge of 937c3742 to klp-dev-plus-aosp
Change-Id: I4c0ad42ea3802cd232c80e5589af8a8e25f88a60
This commit is contained in:
commit
e5911f3128
@ -1874,10 +1874,10 @@ static bool _using_default_dns(const char *iface)
|
||||
if (iface == NULL || *iface == '\0') return true;
|
||||
|
||||
if_len = _resolv_get_default_iface(buf, sizeof(buf));
|
||||
if (if_len + 1 <= sizeof(buf)) {
|
||||
if (strcmp(buf, iface) != 0) return false;
|
||||
if (if_len != 0 && if_len + 1 <= sizeof(buf)) {
|
||||
if (strcmp(buf, iface) == 0) return true;
|
||||
}
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
/*ARGSUSED*/
|
||||
|
@ -2603,19 +2603,16 @@ _resolv_get_default_iface(char* buff, size_t buffLen)
|
||||
|
||||
char* ifname = _get_default_iface_locked(); // never null, but may be empty
|
||||
|
||||
// if default interface not set. Get first cache with an interface
|
||||
// if default interface not set give up.
|
||||
if (ifname[0] == '\0') {
|
||||
ifname = _find_any_iface_name_locked(); // may be null
|
||||
pthread_mutex_unlock(&_res_cache_list_lock);
|
||||
return 0;
|
||||
}
|
||||
|
||||
size_t len = 0;
|
||||
// if we got the default iface or if (no-default) the find_any call gave an answer
|
||||
if (ifname) {
|
||||
len = strlen(ifname);
|
||||
if (len < buffLen) {
|
||||
strncpy(buff, ifname, len);
|
||||
buff[len] = '\0';
|
||||
}
|
||||
size_t len = strlen(ifname);
|
||||
if (len < buffLen) {
|
||||
strncpy(buff, ifname, len);
|
||||
buff[len] = '\0';
|
||||
} else {
|
||||
buff[0] = '\0';
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user