Comment 102 for bug 1754671

Revision history for this message
In , Thomas Haller (thaller-1) wrote :

> dns: dnsmasq: fix adding multiple domains

can you add a "Fixes" comment?

> core: allow '~.' domain in ip4 and ip6 configs

+ if (!nm_streq (search, "~.")) {
          len = strlen (search);
          if (search[len - 1] == '.')
               search[len - 1] = 0;
+ }

this seems wrong, for example if "search" is "~..".
Either, do a full normalization and drop such entires (or clean up the duplicate dots). Or: normalize "~." to "~" too. It's odd that the special domain is treated entirely different regardingt the trailing dot.

> dns: use dns-priority to provide a preprocessed domain list to plugins

          _LOGD ("update-dns: updating plugin %s", plugin_name);
+ rebuild_domain_lists (self);
          if (!nm_dns_plugin_update (plugin,

do we need to rebuild the list every time? We know when an update changes something. Can we cache the result, generate it when needed, and clear it when something changes?

+ struct {
+ const char **search;
+ char **reverse;
+ } domains;
 } NMDnsIPConfigData;

I think these are leaked.

> dns: dnsmasq: honor dns-priority

+ int addr_family, i, j, num;

let's use guint for index variables of arrays? Also matches
  num = nm_ip_config_get_num_nameservers (ip_config);

> dns: sd-resolved: honor dns-priority

- NMIPConfig *ip_config = elem->data;
+ NMDnsIPConfigData *data = elem->data;
+ NMIPConfig *ip_config = data->ip_config;

this seems wrong.

Overall, lgtm