mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-02-01 06:50:30 +01:00
dns: assert domains are unset at start of rebuild_domain_lists()
(cherry picked from commita875d154de) (cherry picked from commit83c760014e)
This commit is contained in:
parent
50e04c6bc3
commit
5239cb1e07
1 changed files with 13 additions and 3 deletions
|
|
@ -1323,6 +1323,16 @@ rebuild_domain_lists (NMDnsManager *self)
|
|||
int prev_priority = G_MININT;
|
||||
|
||||
head = _ip_config_lst_head (self);
|
||||
|
||||
#if NM_MORE_ASSERTS
|
||||
/* we call clear_domain_lists() at the end of update. We
|
||||
* don't expect any domain settings here. */
|
||||
c_list_for_each_entry (ip_data, head, ip_config_lst) {
|
||||
nm_assert (!ip_data->domains.search);
|
||||
nm_assert (!ip_data->domains.reverse);
|
||||
}
|
||||
#endif
|
||||
|
||||
c_list_for_each_entry (ip_data, head, ip_config_lst) {
|
||||
NMIPConfig *ip_config = ip_data->ip_config;
|
||||
gboolean add_wildcard = FALSE;
|
||||
|
|
@ -1377,9 +1387,7 @@ rebuild_domain_lists (NMDnsManager *self)
|
|||
|
||||
cap_dom = 2u + NM_MAX (n_domains, n_searches);
|
||||
|
||||
g_free (ip_data->domains.search);
|
||||
domains = g_new (const char *, cap_dom);
|
||||
ip_data->domains.search = domains;
|
||||
|
||||
num_dom1 = 0;
|
||||
|
||||
|
|
@ -1445,7 +1453,9 @@ rebuild_domain_lists (NMDnsManager *self)
|
|||
nm_assert (num_dom2 < cap_dom);
|
||||
domains[num_dom2] = NULL;
|
||||
|
||||
g_strfreev (ip_data->domains.reverse);
|
||||
nm_assert (!ip_data->domains.search);
|
||||
nm_assert (!ip_data->domains.reverse);
|
||||
ip_data->domains.search = domains;
|
||||
ip_data->domains.reverse = get_ip_rdns_domains (ip_config);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue