From b18d81ae9faf6adcf4020680bc5d874bf92848c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?louiz=E2=80=99?= Date: Tue, 25 Feb 2020 22:52:58 +0100 Subject: Fix a typo in a function name (match_pairt) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It’s totally harmless --- src/network/tcp_client_socket_handler.cpp | 2 +- src/network/tcp_client_socket_handler.hpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src/network') diff --git a/src/network/tcp_client_socket_handler.cpp b/src/network/tcp_client_socket_handler.cpp index 9dda73d..e5b1b75 100644 --- a/src/network/tcp_client_socket_handler.cpp +++ b/src/network/tcp_client_socket_handler.cpp @@ -261,7 +261,7 @@ std::string TCPClientSocketHandler::get_port() const return this->port; } -bool TCPClientSocketHandler::match_port_pairt(const uint16_t local, const uint16_t remote) const +bool TCPClientSocketHandler::match_port_pair(const uint16_t local, const uint16_t remote) const { const auto remote_port = static_cast(std::stoi(this->port)); return this->is_connected() && local == this->local_port && remote == remote_port; diff --git a/src/network/tcp_client_socket_handler.hpp b/src/network/tcp_client_socket_handler.hpp index 74caca9..38d8b84 100644 --- a/src/network/tcp_client_socket_handler.hpp +++ b/src/network/tcp_client_socket_handler.hpp @@ -34,7 +34,7 @@ class TCPClientSocketHandler: public TCPSocketHandler /** * Whether or not this connection is using the two given TCP ports. */ - bool match_port_pairt(const uint16_t local, const uint16_t remote) const; + bool match_port_pair(const uint16_t local, const uint16_t remote) const; protected: bool hostname_resolution_failed; -- cgit v1.2.3 From 23f3f48b4aaca4d933b0fc448482c463dd2f31be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?louiz=E2=80=99?= Date: Tue, 25 Feb 2020 22:53:37 +0100 Subject: Only consider sockets that are in valid states as identd candidates MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When an identd query happens, we check all the connected sockets for their local and remote ports, to compare them with the query. But we MUST only consider the connected ones because: - It doesn’t make sense to answer for a connection that has just been closed - A non-connected sockets is not in a valid state for this (specifically here: its ::port attribute is empty) fix #3421 --- src/network/tcp_client_socket_handler.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/network') diff --git a/src/network/tcp_client_socket_handler.cpp b/src/network/tcp_client_socket_handler.cpp index e5b1b75..dcf38f9 100644 --- a/src/network/tcp_client_socket_handler.cpp +++ b/src/network/tcp_client_socket_handler.cpp @@ -263,6 +263,8 @@ std::string TCPClientSocketHandler::get_port() const bool TCPClientSocketHandler::match_port_pair(const uint16_t local, const uint16_t remote) const { + if (!this->is_connected()) + return false; const auto remote_port = static_cast(std::stoi(this->port)); - return this->is_connected() && local == this->local_port && remote == remote_port; + return local == this->local_port && remote == remote_port; } -- cgit v1.2.3 From 9913518178b582abcd5cac69e2f6c96866801f77 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?louiz=E2=80=99?= Date: Fri, 30 Aug 2019 11:40:42 +0200 Subject: Add an error message for udns error DNS_E_NODATA (cherry-picked from master) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In cases where the DNS server does not respond “domain not found” but “domain found, but no IP for that record type”, we just say “domain not found” too (instead of nothing, previously). --- src/network/resolver.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src/network') diff --git a/src/network/resolver.cpp b/src/network/resolver.cpp index ef54ba2..ae5cecd 100644 --- a/src/network/resolver.cpp +++ b/src/network/resolver.cpp @@ -21,6 +21,7 @@ static std::map dns_error_messages { {DNS_E_TEMPFAIL, "Timeout while contacting DNS servers"}, {DNS_E_PROTOCOL, "Misformatted DNS reply"}, {DNS_E_NXDOMAIN, "Domain name not found"}, + {DNS_E_NODATA, "Domain name not found"}, {DNS_E_NOMEM, "Out of memory"}, {DNS_E_BADQUERY, "Misformatted domain name"} }; -- cgit v1.2.3