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:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user