mirror of
https://github.com/systemd/systemd-stable.git
synced 2024-12-21 09:33:57 +03:00
resolved: Fall back to TCP if UDP is blocked
If UDP is blocked on the system (e.g. by iptables or BPF), the kernel will return EPERM on some or all of the system calls (connect, sendmsg, etc.). In this case, try to fall back to TCP, which hopefully will not be blocked. (cherry picked from commit3dd6336ad0
) (cherry picked from commita88e35bf95
) (cherry picked from commit58cbb7a89b
) (cherry picked from commit5f6a369a6a
)
This commit is contained in:
parent
85771e8df5
commit
74d5f34b0a
@ -2029,7 +2029,9 @@ int dns_transaction_go(DnsTransaction *t) {
|
||||
log_debug("Sending query via TCP since it is too large.");
|
||||
else if (r == -EAGAIN)
|
||||
log_debug("Sending query via TCP since UDP isn't supported or DNS-over-TLS is selected.");
|
||||
if (IN_SET(r, -EMSGSIZE, -EAGAIN))
|
||||
else if (r == -EPERM)
|
||||
log_debug("Sending query via TCP since UDP is blocked.");
|
||||
if (IN_SET(r, -EMSGSIZE, -EAGAIN, -EPERM))
|
||||
r = dns_transaction_emit_tcp(t);
|
||||
}
|
||||
if (r == -ELOOP) {
|
||||
|
Loading…
Reference in New Issue
Block a user