include/netinet/arp.h: change the type of arp_dev from uint8_t to char

the same variable type in linux is char, in order to avoid modifying
the third-party library code when porting the third-party library code.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
This commit is contained in:
zhanghongyu 2024-12-23 10:10:23 +08:00 committed by Xiang Xiao
parent 54e85075c4
commit 05f7b7ac97
3 changed files with 3 additions and 4 deletions

View file

@ -71,7 +71,7 @@ struct aligned_data(sizeof(uint32_t)) arpreq
struct sockaddr arp_ha; /* Hardware address */
struct sockaddr arp_netmask; /* Netmask of protocol address */
uint8_t arp_flags; /* Flags */
uint8_t arp_dev[IFNAMSIZ + 1]; /* Device name (zero terminated) */
char arp_dev[IFNAMSIZ + 1]; /* Device name (zero terminated) */
};
/****************************************************************************

View file

@ -243,8 +243,7 @@ static void arp_get_arpreq(FAR struct arpreq *output,
outaddr->sin_addr.s_addr = input->at_ipaddr;
memcpy(output->arp_ha.sa_data, input->at_ethaddr.ether_addr_octet,
sizeof(struct ether_addr));
strlcpy((FAR char *)output->arp_dev, input->at_dev->d_ifname,
sizeof(output->arp_dev));
strlcpy(output->arp_dev, input->at_dev->d_ifname, sizeof(output->arp_dev));
}
#endif

View file

@ -1361,7 +1361,7 @@ static bool ioctl_arpreq_parse(FAR struct arpreq *req,
{
*addr = (FAR struct sockaddr_in *)&req->arp_pa;
*dev = req->arp_dev[0] != '\0' ?
netdev_findbyname((FAR const char *)req->arp_dev) :
netdev_findbyname(req->arp_dev) :
netdev_findby_ripv4addr(INADDR_ANY, (*addr)->sin_addr.s_addr);
return true;
}