#include <unistd.h>
#endif
#include <sys/uio.h>
+#include <errno.h>
#include "conf.h"
#include "externs.h"
bp = buf;
if (getnameinfo(&remote.addr, rlen, host, sizeof host, NULL, 0,
- NI_NUMERICHOST | NI_NUMERICSERV) != 0)
- safe_str("An error occured", buf, &bp);
- else
+ NI_NUMERICHOST | NI_NUMERICSERV) != 0) {
+ safe_str("Error: getnameinfo(remote): ", buf, &bp);
+ safe_str(strerror(errno), buf, &bp);
+ } else {
safe_str(host, buf, &bp);
+ }
safe_chr('^', buf, &bp);
if (getnameinfo(&local.addr, llen, NULL, 0, lport, sizeof lport,
- NI_NUMERICHOST | NI_NUMERICSERV) != 0)
- safe_str("An error occured", buf, &bp);
- else
+ NI_NUMERICHOST | NI_NUMERICSERV) != 0) {
+ safe_str("Error: getnameinfo(local): ", buf, &bp);
+ safe_str(strerror(errno), buf, &bp);
+ } else {
safe_str(lport, buf, &bp);
+ }
safe_chr('^', buf, &bp);
if (use_ident > 0) {
if (use_dns) {
if (getnameinfo(&remote.addr, rlen, host, sizeof host, NULL, 0,
NI_NUMERICSERV) != 0) {
- safe_str("An error occured", buf, &bp);
+ safe_str("Error: getnameinfo(local/dns): ", buf, &bp);
+ safe_str(strerror(errno), buf, &bp);
} else {
safe_str(host, buf, &bp);
}