mirror of
https://github.com/apache/nuttx-apps.git
synced 2025-10-19 02:17:37 +08:00
arp: change arptable get struct from arp_entry_s to arpreq
Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
This commit is contained in:
@@ -72,7 +72,7 @@ struct netlib_recvfrom_response_s
|
||||
* Parameters:
|
||||
* arptab - The location to store the copy of the ARP table
|
||||
* nentries - The size of the provided 'arptab' in number of entries each
|
||||
* of size sizeof(struct arp_entry_s)
|
||||
* of size sizeof(struct arpreq)
|
||||
*
|
||||
* Return:
|
||||
* The number of ARP table entries read is returned on success; a negated
|
||||
@@ -80,7 +80,7 @@ struct netlib_recvfrom_response_s
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
ssize_t netlib_get_arptable(FAR struct arp_entry_s *arptab,
|
||||
ssize_t netlib_get_arptable(FAR struct arpreq *arptab,
|
||||
unsigned int nentries)
|
||||
{
|
||||
FAR struct netlib_recvfrom_response_s *resp;
|
||||
@@ -99,7 +99,7 @@ ssize_t netlib_get_arptable(FAR struct arp_entry_s *arptab,
|
||||
|
||||
/* Pre-allocate a buffer to hold the response */
|
||||
|
||||
maxsize = nentries * sizeof(struct arp_entry_s);
|
||||
maxsize = nentries * sizeof(struct arpreq);
|
||||
allocsize = SIZEOF_NETLIB_RECVFROM_RESPONSE_S(maxsize);
|
||||
resp = (FAR struct netlib_recvfrom_response_s *)malloc(allocsize);
|
||||
if (resp == NULL)
|
||||
@@ -201,7 +201,7 @@ ssize_t netlib_get_arptable(FAR struct arp_entry_s *arptab,
|
||||
}
|
||||
|
||||
memcpy(arptab, resp->data, paysize);
|
||||
ret = paysize / sizeof(struct arp_entry_s);
|
||||
ret = paysize / sizeof(struct arpreq);
|
||||
|
||||
errout_with_socket:
|
||||
close(fd);
|
||||
|
Reference in New Issue
Block a user