resolve: make DnsStubListenerMode bitfield
This commit is contained in:
parent
8ae07803a0
commit
88d2cb7c0e
|
@ -7,9 +7,9 @@ typedef enum DnsStubListenerMode DnsStubListenerMode;
|
|||
|
||||
enum DnsStubListenerMode {
|
||||
DNS_STUB_LISTENER_NO,
|
||||
DNS_STUB_LISTENER_UDP,
|
||||
DNS_STUB_LISTENER_TCP,
|
||||
DNS_STUB_LISTENER_YES,
|
||||
DNS_STUB_LISTENER_UDP = 1 << 0,
|
||||
DNS_STUB_LISTENER_TCP = 1 << 1,
|
||||
DNS_STUB_LISTENER_YES = DNS_STUB_LISTENER_UDP | DNS_STUB_LISTENER_TCP,
|
||||
_DNS_STUB_LISTENER_MODE_MAX,
|
||||
_DNS_STUB_LISTENER_MODE_INVALID = -1
|
||||
};
|
||||
|
|
|
@ -684,11 +684,11 @@ int manager_dns_stub_start(Manager *m) {
|
|||
m->dns_stub_listener_mode == DNS_STUB_LISTENER_TCP ? "TCP" :
|
||||
"UDP/TCP");
|
||||
|
||||
if (IN_SET(m->dns_stub_listener_mode, DNS_STUB_LISTENER_YES, DNS_STUB_LISTENER_UDP))
|
||||
if (FLAGS_SET(m->dns_stub_listener_mode, DNS_STUB_LISTENER_UDP))
|
||||
r = manager_dns_stub_udp_fd(m);
|
||||
|
||||
if (r >= 0 &&
|
||||
IN_SET(m->dns_stub_listener_mode, DNS_STUB_LISTENER_YES, DNS_STUB_LISTENER_TCP)) {
|
||||
FLAGS_SET(m->dns_stub_listener_mode, DNS_STUB_LISTENER_TCP)) {
|
||||
t = "TCP";
|
||||
r = manager_dns_stub_tcp_fd(m);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue