From: Lennart Poettering Date: Fri, 21 Aug 2015 20:51:05 +0000 (+0200) Subject: resolved: add extra check for family when doing LLMNR TCP connections X-Git-Tag: v225~35^2~2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=9e08a6e0ce6ae37189666fd2517e643e971e45b1;p=thirdparty%2Fsystemd.git 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. --- diff --git a/src/resolve/resolved-dns-transaction.c b/src/resolve/resolved-dns-transaction.c index 73bfbb7ed4c..3fc40639179 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); }