From 1097a5c7c2b319540d1ec7161d49689fb4d0e284 Mon Sep 17 00:00:00 2001 From: Emery Hemingway Date: Thu, 3 May 2018 16:14:30 +0200 Subject: [PATCH] Libc: ignore address argument to TCP sendto Generic code that operates over both UDP and TCP sockets might use 'sendto', but in the case of TCP the destination address ought to be safely discarded. This seems to be the case for certain DNS software that operates over both UDP and TCP. Fix #2807 --- repos/libports/src/lib/libc/socket_fs_plugin.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/repos/libports/src/lib/libc/socket_fs_plugin.cc b/repos/libports/src/lib/libc/socket_fs_plugin.cc index 1f3fb8e5e9..1b9b63045e 100644 --- a/repos/libports/src/lib/libc/socket_fs_plugin.cc +++ b/repos/libports/src/lib/libc/socket_fs_plugin.cc @@ -666,7 +666,7 @@ static ssize_t do_sendto(Libc::File_descriptor *fd, /* TODO ECONNRESET */ try { - if (dest_addr) { + if (dest_addr && context->proto() == Context::Proto::UDP) { try { Sockaddr_string addr_string(host_string(*(sockaddr_in const *)dest_addr), port_string(*(sockaddr_in const *)dest_addr));