From 358d221aa3ab6670bca3214184ad913a87cfe822 Mon Sep 17 00:00:00 2001 From: dmiller Date: Wed, 4 Oct 2017 18:27:30 +0000 Subject: [PATCH] Add debug info with getaddrinfo error --- tcpip.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tcpip.cc b/tcpip.cc index 7ea71a3ad..cbfcf3f97 100644 --- a/tcpip.cc +++ b/tcpip.cc @@ -484,8 +484,11 @@ struct addrinfo *resolve_all(const char *hostname, int pf) { /* Otherwise we get multiple identical addresses with different socktypes. */ hints.ai_socktype = SOCK_DGRAM; rc = getaddrinfo(hostname, NULL, &hints, &result); - if (rc != 0) + if (rc != 0){ + if (o.debugging > 1) + error("Error resolving %s: %s", hostname, gai_strerror(rc)); return NULL; + } return result; }