You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2022/12/13 19:12:26 UTC

[GitHub] [nuttx] pkarashchenko commented on a diff in pull request #7862: arp rules bind to nics

pkarashchenko commented on code in PR #7862:
URL: https://github.com/apache/nuttx/pull/7862#discussion_r1047624408


##########
net/arp/arp_table.c:
##########
@@ -464,7 +475,16 @@ unsigned int arp_snapshot(FAR struct arp_entry_s *snapshot,
       if (tabptr->at_ipaddr != 0 &&
           now - tabptr->at_time <= ARP_MAXAGE_TICK)
         {
-          memcpy(&snapshot[ncopied], tabptr, sizeof(struct arp_entry_s));
+          outaddr = (FAR struct sockaddr_in *)&snapshot[ncopied].arp_pa;
+          outaddr->sin_family      = AF_INET;
+          outaddr->sin_port        = 0;
+          outaddr->sin_addr.s_addr = tabptr->at_ipaddr;
+          memcpy(snapshot[ncopied].arp_ha.sa_data,
+                 tabptr->at_ethaddr.ether_addr_octet,
+                 sizeof(struct ether_addr));
+          strlcpy((char *)snapshot[ncopied].arp_dev,

Review Comment:
   ```suggestion
             strlcpy((FAR char *)snapshot[ncopied].arp_dev,
   ```



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

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org