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.
This commit is contained in:
Lennart Poettering 2015-08-21 22:51:05 +02:00
parent 0a18f3e59f
commit 9e08a6e0ce
1 changed files with 2 additions and 0 deletions

View File

@ -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);
}