diff options
author | Lennart Poettering <lennart@poettering.net> | 2015-11-24 17:59:40 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2015-11-25 21:58:37 +0100 |
commit | 0eac462399c8e87bcce252cf058eba9f2678f2bd (patch) | |
tree | 31f3297ad47d256ebcc5dba55697e21431341174 /src/resolve/resolved-link.h | |
parent | f2f1dbe50fea13abadc9c1e845a29031b90b40f3 (diff) | |
download | systemd-0eac462399c8e87bcce252cf058eba9f2678f2bd.tar.gz |
resolved: rework dns server lifecycle logic
Previously, there was a chance of memory corruption, because when
switching to the next DNS server we didn't care whether they linked list
of DNS servers was still valid.
Clean up lifecycle of the dns server logic:
- When a DnsServer object is still in the linked list of DnsServers for
a link or the manager, indicate so with a "linked" boolean field, and
never follow the linked list if that boolean is not set.
- When picking a DnsServer to use for a link ot manager, always
explicitly take a reference.
This also rearranges some logic, to make the tracking of dns servers by
link and globally more alike.
Diffstat (limited to 'src/resolve/resolved-link.h')
-rw-r--r-- | src/resolve/resolved-link.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/resolve/resolved-link.h b/src/resolve/resolved-link.h index e3ab27c249..76e96e733a 100644 --- a/src/resolve/resolved-link.h +++ b/src/resolve/resolved-link.h @@ -75,6 +75,10 @@ bool link_relevant(Link *l, int family); LinkAddress* link_find_address(Link *l, int family, const union in_addr_union *in_addr); void link_add_rrs(Link *l, bool force_remove); +void link_flush_dns_servers(Link *l); +void link_flush_marked_dns_servers(Link *l); +void link_mark_dns_servers(Link *l); + DnsServer* link_set_dns_server(Link *l, DnsServer *s); DnsServer* link_find_dns_server(Link *l, int family, const union in_addr_union *in_addr); DnsServer* link_get_dns_server(Link *l); |