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.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/issues/80

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/47
This commit is contained in:
Kyle Walker 2018-11-08 13:11:18 -05:00 committed by Thomas Haller
parent 49c11a44e4
commit 3f2cc579e7

View file

@ -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);