summaryrefslogtreecommitdiff
path: root/src/resolve
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2015-08-21 22:51:05 +0200
committerLennart Poettering <lennart@poettering.net>2015-08-21 22:51:05 +0200
commit9e08a6e0ce6ae37189666fd2517e643e971e45b1 (patch)
tree39e4229d2058c0847bf9d07ba1017b07abdf0f0a /src/resolve
parent0a18f3e59f887f27431759443374cd559fce729d (diff)
resolved: add extra check for family when doing LLMNR TCP connections
It shouldn't happen that we try to resolve IPv4 addresses via LLMNR on IPv6 and vice versa, but let's explicitly verify that we don't turn an IPv4 LLMNR lookup into an IPv6 TCP connection.
Diffstat (limited to 'src/resolve')
-rw-r--r--src/resolve/resolved-dns-transaction.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/resolve/resolved-dns-transaction.c b/src/resolve/resolved-dns-transaction.c
index 73bfbb7ed4..3fc4063917 100644
--- a/src/resolve/resolved-dns-transaction.c
+++ b/src/resolve/resolved-dns-transaction.c
@@ -271,6 +271,8 @@ static int dns_transaction_open_tcp(DnsTransaction *t) {
return r;
if (r == 0)
return -EINVAL;
+ if (family != t->scope->family)
+ return -EAFNOSUPPORT;
fd = dns_scope_tcp_socket(t->scope, family, &address, LLMNR_PORT, NULL);
}