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



##########
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:
       Ok, but line 440-441 need be removed too.




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