diff options
author | Lennart Poettering <lennart@poettering.net> | 2015-11-24 20:50:37 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2015-11-25 21:58:38 +0100 |
commit | 0b58db658b5c3f586ac3a837427f1f7fec2abb2e (patch) | |
tree | fdb47d9ceee7a7d07637ba5d5f2682a3d9d2074d /src/resolve/resolved-dns-server.h | |
parent | 444d77fd014d86f3b211abf52981bfb34e7e78be (diff) |
resolved: make sure order of dns servers is stable
Previously, we'd keep adding new dns servers we discover to the end of
our linked list of servers. When we encountered a pre-existing server,
we'd just leave it where it was. In essence that meant that old servers
ended up at the front, and new servers at the end, but not in an order
that would reflect the configuration.
With this change we ensure that every pre-existing server we want to add
again we move to the back of the linked list, so that the order is
stable and in sync with the requested configuration.
Diffstat (limited to 'src/resolve/resolved-dns-server.h')
-rw-r--r-- | src/resolve/resolved-dns-server.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/resolve/resolved-dns-server.h b/src/resolve/resolved-dns-server.h index 9fed8f74a2..0077456cbc 100644 --- a/src/resolve/resolved-dns-server.h +++ b/src/resolve/resolved-dns-server.h @@ -31,6 +31,7 @@ typedef enum DnsServerType { DNS_SERVER_LINK, } DnsServerType; +#include "resolved-manager.h" #include "resolved-link.h" struct DnsServer { @@ -39,7 +40,6 @@ struct DnsServer { unsigned n_ref; DnsServerType type; - Link *link; int family; @@ -57,9 +57,9 @@ struct DnsServer { int dns_server_new( Manager *m, - DnsServer **s, + DnsServer **ret, DnsServerType type, - Link *l, + Link *link, int family, const union in_addr_union *address); @@ -67,6 +67,7 @@ DnsServer* dns_server_ref(DnsServer *s); DnsServer* dns_server_unref(DnsServer *s); void dns_server_unlink(DnsServer *s); +void dns_server_move_back_and_unmark(DnsServer *s); void dns_server_packet_received(DnsServer *s, usec_t rtt); void dns_server_packet_lost(DnsServer *s, usec_t usec); |