arp: change arptable get struct from arp_entry_s to arpreq

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
This commit is contained in:
zhanghongyu
2022-12-11 21:36:23 +08:00
committed by Xiang Xiao
parent df3121213e
commit c7e8ade590
4 changed files with 45 additions and 43 deletions

View File

@@ -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);