mirror of
https://github.com/apache/nuttx-apps.git
synced 2025-10-19 11:23:07 +08:00
Replace self defined macros with NET_SOCK_[FAMILY|TYPE|PROTOCOL]
NET_SOCK_* is defined by nuttx/net/netconfig.h and then can be shared Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:

committed by
Gustavo Henrique Nihei

parent
fcd69d1cdf
commit
66dbaa4539
@@ -65,8 +65,7 @@ int netlib_setmacaddr(const char *ifname, const uint8_t *macaddr)
|
||||
{
|
||||
/* Get a socket (only so that we get access to the INET subsystem) */
|
||||
|
||||
int sockfd = socket(NETLIB_SOCK_FAMILY,
|
||||
NETLIB_SOCK_TYPE, NETLIB_SOCK_PROTOCOL);
|
||||
int sockfd = socket(NET_SOCK_FAMILY, NET_SOCK_TYPE, NET_SOCK_PROTOCOL);
|
||||
if (sockfd >= 0)
|
||||
{
|
||||
struct ifreq req;
|
||||
@@ -77,7 +76,7 @@ int netlib_setmacaddr(const char *ifname, const uint8_t *macaddr)
|
||||
|
||||
/* Put the new MAC address into the request */
|
||||
|
||||
req.ifr_hwaddr.sa_family = NETLIB_SOCK_FAMILY;
|
||||
req.ifr_hwaddr.sa_family = NET_SOCK_FAMILY;
|
||||
memcpy(&req.ifr_hwaddr.sa_data, macaddr, IFHWADDRLEN);
|
||||
|
||||
/* Perform the ioctl to set the MAC address */
|
||||
|
Reference in New Issue
Block a user