diff --git a/ares/ares_parse_srv_reply.c b/ares/ares_parse_srv_reply.c
index 1d1b98ddf39433973ec821453c6a1a0d6a599c9e..61f0be1ea7b143e576492a476e3e4ae78b910a6f 100644
--- a/ares/ares_parse_srv_reply.c
+++ b/ares/ares_parse_srv_reply.c
@@ -120,12 +120,12 @@ ares_parse_srv_reply (const unsigned char *abuf, int alen,
               break;
             }
 
-          srv[i].priority = ntohs (*((uint16_t *)aptr));
-          aptr += sizeof(uint16_t);
-          srv[i].weight = ntohs (*((uint16_t *)aptr));
-          aptr += sizeof(uint16_t);
-          srv[i].port = ntohs (*((uint16_t *)aptr));
-          aptr += sizeof(uint16_t);
+          srv[i].priority = ntohs (*((u_int16_t *)aptr));
+          aptr += sizeof(u_int16_t);
+          srv[i].weight = ntohs (*((u_int16_t *)aptr));
+          aptr += sizeof(u_int16_t);
+          srv[i].port = ntohs (*((u_int16_t *)aptr));
+          aptr += sizeof(u_int16_t);
 
           status = ares_expand_name (aptr, abuf, alen, &srv[i].host, &len);
           if (status != ARES_SUCCESS)