Improve error message when binding http port.
[darkstat] / dns.c
diff --git a/dns.c b/dns.c
index df2342b..e8bdbb4 100644 (file)
--- a/dns.c
+++ b/dns.c
@@ -198,8 +198,9 @@ dns_get_result(struct addr *ipaddr, char **name)
             type = "site-local";
          else if (IN6_IS_ADDR_MULTICAST(&reply.addr.ip.v6))
             type = "multicast";
-      } else { /* AF_INET */
-         if (IN_MULTICAST(reply.addr.ip.v4))
+      } else {
+         assert(reply.addr.family == IPv4);
+         if (IN_MULTICAST(htonl(reply.addr.ip.v4)))
             type = "multicast";
       }
       xasprintf(name, "(%s)", type);