aboutsummaryrefslogtreecommitdiffstats
path: root/camel/camel-service.c
diff options
context:
space:
mode:
Diffstat (limited to 'camel/camel-service.c')
-rw-r--r--camel/camel-service.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/camel/camel-service.c b/camel/camel-service.c
index b916d5c05a..81bb9c85e6 100644
--- a/camel/camel-service.c
+++ b/camel/camel-service.c
@@ -969,13 +969,15 @@ cs_getnameinfo(void *data)
if (msg->host) {
g_free(msg->host);
+ msg->host = NULL;
if (msg->result == 0 && h.h_name && h.h_name[0]) {
msg->host = g_strdup(h.h_name);
- } else {
+ } else if ((msg->flags & NI_NAMEREQD) == 0) {
unsigned char *in = (unsigned char *)&sin->sin_addr;
/* sin_addr is always network order which is big-endian */
msg->host = g_strdup_printf("%u.%u.%u.%u", in[0], in[1], in[2], in[3]);
+ msg->result = 0;
}
}