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



##########
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_header_s and dns_question_s don't have __attribute__((packed)), why 
you consider they are packed?




-- 
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