Always set error messages in ip_hton
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Mon, 20 Jul 2015 15:48:13 +0000 (11:48 -0400)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Mon, 20 Jul 2015 18:52:21 +0000 (14:52 -0400)
src/lib/misc.c

index a4b92a4..e5a7144 100644 (file)
@@ -1003,7 +1003,10 @@ int ip_hton(fr_ipaddr_t *out, int af, char const *hostname, bool fallback)
        rcode = fr_sockaddr2ipaddr((struct sockaddr_storage *)ai->ai_addr,
                                   ai->ai_addrlen, out, NULL);
        freeaddrinfo(res);
-       if (!rcode) return -1;
+       if (!rcode) {
+               fr_strerror_printf("Failed converting sockaddr to ipaddr");
+               return -1;
+       }
 
        return 0;
 }