Virus-V commented on a change in pull request #3889:
URL: https://github.com/apache/incubator-nuttx/pull/3889#discussion_r648861272



##########
File path: libs/libc/netdb/lib_dnsquery.c
##########
@@ -439,8 +440,11 @@ static int dns_recv_response(int sd, FAR union dns_addr_u 
*addr, int naddr,
   ninfo("Question: type=%04x, class=%04x\n",
         ntohs(que->type), ntohs(que->class));
 
-  if (que->type  != qinfo->rectype ||
-      que->class != HTONS(DNS_CLASS_IN))
+  /* N.B. Unaligned access may occur here */
+
+  temp = HTONS(DNS_CLASS_IN);
+  if (memcmp(&que->type, &qinfo->rectype, sizeof(uint16_t)) != 0 ||

Review comment:
       dns_question_s is part of the dns response message. There is a variable 
length area in front of this structure. I am talking about the DNS response 
message, not the dns_question_s structure. 




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to