mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-15 00:10:22 +01:00
dns: assert that priorities in rebuild_domain_lists() are increasing
This is nm_assert(). The compiler should be able to completely eliminate this code in production. (cherry picked from commit05f8ccc817) (cherry picked from commit0bfc2b6db9)
This commit is contained in:
parent
4ed2ceda10
commit
50e04c6bc3
1 changed files with 4 additions and 0 deletions
|
|
@ -1320,6 +1320,7 @@ rebuild_domain_lists (NMDnsManager *self)
|
|||
gs_unref_hashtable GHashTable *ht = NULL;
|
||||
gs_unref_hashtable GHashTable *wildcard_entries = NULL;
|
||||
CList *head;
|
||||
int prev_priority = G_MININT;
|
||||
|
||||
head = _ip_config_lst_head (self);
|
||||
c_list_for_each_entry (ip_data, head, ip_config_lst) {
|
||||
|
|
@ -1369,7 +1370,10 @@ rebuild_domain_lists (NMDnsManager *self)
|
|||
n_domains = nm_ip_config_get_num_domains (ip_config);
|
||||
|
||||
priority = nm_ip_config_get_dns_priority (ip_config);
|
||||
|
||||
nm_assert (priority != 0);
|
||||
nm_assert (prev_priority <= priority);
|
||||
prev_priority = priority;
|
||||
|
||||
cap_dom = 2u + NM_MAX (n_domains, n_searches);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue