Commit 3f2cc579 authored by Kyle Walker's avatar Kyle Walker Committed by Thomas Haller
Browse files

dns: remove the resolv.conf 6 entry limit

The resolv.conf used to have a limit of 6 entries for the search option.
With later versions of glibc, this limit has been removed. As a result,
remove the limit here so that all search entries set will be applied to the
resolv.conf. If there is a limit imposed by older versions of glibc, it
should be imposed there as opposed to within NetworkManager.

#80

!47
parent 49c11a44
......@@ -1100,7 +1100,6 @@ _collect_resolv_conf_data (NMDnsManager *self,
const char **out_nis_domain)
{
NMDnsManagerPrivate *priv;
guint i, num, len;
NMResolvConfData rc = {
.nameservers = g_ptr_array_new (),
.searches = g_ptr_array_new (),
......@@ -1170,17 +1169,6 @@ _collect_resolv_conf_data (NMDnsManager *self,
}
}
/* Per 'man resolv.conf', the search list is limited to 6 domains
* totalling 256 characters.
*/
num = MIN (rc.searches->len, 6u);
for (i = 0, len = 0; i < num; i++) {
len += strlen (rc.searches->pdata[i]) + 1; /* +1 for spaces */
if (len > 256)
break;
}
g_ptr_array_set_size (rc.searches, i);
*out_searches = _ptrarray_to_strv (rc.searches);
*out_options = _ptrarray_to_strv (rc.options);
*out_nameservers = _ptrarray_to_strv (rc.nameservers);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment