diff --git a/src/dns_server.c b/src/dns_server.c index f7b3c78..84da0d6 100644 --- a/src/dns_server.c +++ b/src/dns_server.c @@ -1354,7 +1354,7 @@ static int _dns_server_process_answer_AAAA(struct dns_rrs *rrs, struct dns_reque return -1; } - sprintf(ip, "%.2x%.2x:%.2x%.2x:%.2x%.2x:%.2x%.2x:%.2x%.2x:%.2x%.2x:%.2x%.2x:%.2x%.2x", addr[0], addr[1], addr[2], addr[3], addr[4], addr[5], addr[6], + sprintf(ip, "[%.2x%.2x:%.2x%.2x:%.2x%.2x:%.2x%.2x:%.2x%.2x:%.2x%.2x:%.2x%.2x:%.2x%.2x]", addr[0], addr[1], addr[2], addr[3], addr[4], addr[5], addr[6], addr[7], addr[8], addr[9], addr[10], addr[11], addr[12], addr[13], addr[14], addr[15]); /* start ping */ diff --git a/src/fast_ping.c b/src/fast_ping.c index c9b8caa..8fd1b69 100644 --- a/src/fast_ping.c +++ b/src/fast_ping.c @@ -302,7 +302,7 @@ static struct addrinfo *_fast_ping_getaddr(const char *host, const char *port, i hints.ai_protocol = protocol; errcode = getaddrinfo(host, port, &hints, &result); if (errcode != 0) { - tlog(TLOG_ERROR, "get addr info failed. %s\n", gai_strerror(errcode)); + tlog(TLOG_ERROR, "get addr info failed. host:%s, port: %s, error %s\n", host, port, gai_strerror(errcode)); goto errout; } @@ -1007,7 +1007,7 @@ struct ping_host_struct *fast_ping_start(PING_TYPE type, const char *host, int c ret = _fast_ping_get_addr_by_type(type, ip_str, port, &gai, &ping_type); if (ret != 0) { - tlog(TLOG_ERROR, "get addr by type failed."); + tlog(TLOG_ERROR, "get addr by type failed, host: %s", host); goto errout; }