From 6b9d23c6aa0247c701acf1d0ecdaececf546342a Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Mon, 30 Oct 2017 14:16:37 -0600 Subject: [PATCH] Correct and standardize some naming used in the previous commits. --- include/netutils/netlib.h | 44 ++++++++++++------------- netutils/netlib/netlib_autoconfig.c | 2 +- netutils/netlib/netlib_delarp.c | 2 +- netutils/netlib/netlib_getarp.c | 2 +- netutils/netlib/netlib_getdripv4addr.c | 2 +- netutils/netlib/netlib_getessid.c | 2 +- netutils/netlib/netlib_getifstatus.c | 2 +- netutils/netlib/netlib_getipv4addr.c | 2 +- netutils/netlib/netlib_getipv4netmask.c | 2 +- netutils/netlib/netlib_getipv6addr.c | 2 +- netutils/netlib/netlib_getmacaddr.c | 2 +- netutils/netlib/netlib_getnodeaddr.c | 2 +- netutils/netlib/netlib_getpanid.c | 2 +- netutils/netlib/netlib_getproperties.c | 2 +- netutils/netlib/netlib_ipmsfilter.c | 2 +- netutils/netlib/netlib_ipv4adaptor.c | 2 +- netutils/netlib/netlib_ipv6adaptor.c | 2 +- netutils/netlib/netlib_setarp.c | 2 +- netutils/netlib/netlib_setdripv4addr.c | 2 +- netutils/netlib/netlib_setdripv6addr.c | 2 +- netutils/netlib/netlib_seteaddr.c | 2 +- netutils/netlib/netlib_setessid.c | 2 +- netutils/netlib/netlib_setifstatus.c | 4 +-- netutils/netlib/netlib_setipv4addr.c | 2 +- netutils/netlib/netlib_setipv4netmask.c | 2 +- netutils/netlib/netlib_setipv6addr.c | 2 +- netutils/netlib/netlib_setipv6netmask.c | 2 +- netutils/netlib/netlib_setmacaddr.c | 2 +- netutils/netlib/netlib_setnodeaddr.c | 2 +- 29 files changed, 51 insertions(+), 51 deletions(-) diff --git a/include/netutils/netlib.h b/include/netutils/netlib.h index 573e771b3..fb40d7f35 100644 --- a/include/netutils/netlib.h +++ b/include/netutils/netlib.h @@ -79,7 +79,7 @@ /* Using the following defintions, the following socket() arguments should * provide a valid socket in all configurations: * - * ret = socket(NETLIB_AF_FAMILY, NETLIB_SOCK_IOCTL, NETLIB_SOCK_PROTOCOL); + * ret = socket(NETLIB_SOCK_FAMILY, NETLIB_SOCK_TYPE, NETLIB_SOCK_PROTOCOL); */ /* The address family that we used to create the socket really does not @@ -87,17 +87,17 @@ */ #if defined(CONFIG_NET_IPv4) -# define NETLIB_AF_FAMILY AF_INET +# define NETLIB_SOCK_FAMILY AF_INET #elif defined(CONFIG_NET_IPv6) -# define NETLIB_AF_FAMILY AF_INET6 +# define NETLIB_SOCK_FAMILY AF_INET6 #elif defined(CONFIG_NET_LOCAL) -# define NETLIB_AF_FAMILY AF_LOCAL +# define NETLIB_SOCK_FAMILY AF_LOCAL #elif defined(CONFIG_NET_PKT) -# define NETLIB_AF_FAMILY AF_PACKET +# define NETLIB_SOCK_FAMILY AF_PACKET #elif defined(CONFIG_NET_IEEE802154) -# define NETLIB_AF_FAMILY AF_IEEE802154 +# define NETLIB_SOCK_FAMILY AF_IEEE802154 #elif defined(CONFIG_NET_USRSOCK) -# define NETLIB_AF_FAMILY AF_INET +# define NETLIB_SOCK_FAMILY AF_INET #endif /* Socket protocol of zero normally works */ @@ -112,36 +112,36 @@ * selected address family. */ -#if NETLIB_AF_FAMILY == AF_INET +#if NETLIB_SOCK_FAMILY == AF_INET # if defined(CONFIG_NET_UDP) -# define NETLIB_SOCK_IOCTL SOCK_DGRAM +# define NETLIB_SOCK_TYPE SOCK_DGRAM # elif defined(CONFIG_NET_TCP) -# define NETLIB_SOCK_IOCTL SOCK_STREAM +# define NETLIB_SOCK_TYPE SOCK_STREAM # elif defined(CONFIG_NET_ICMP_SOCKET) -# define NETLIB_SOCK_IOCTL SOCK_DGRAM +# define NETLIB_SOCK_TYPE SOCK_DGRAM # undef NETLIB_SOCK_PROTOCOL # define NETLIB_SOCK_PROTOCOL IPPROTO_ICMP # endif -#elif NETLIB_AF_FAMILY == AF_INET6 +#elif NETLIB_SOCK_FAMILY == AF_INET6 # if defined(CONFIG_NET_UDP) -# define NETLIB_SOCK_IOCTL SOCK_DGRAM +# define NETLIB_SOCK_TYPE SOCK_DGRAM # elif defined(CONFIG_NET_TCP) -# define NETLIB_SOCK_IOCTL SOCK_STREAM +# define NETLIB_SOCK_TYPE SOCK_STREAM # elif defined(CONFIG_NET_ICMPv6_SOCKET) -# define NETLIB_SOCK_IOCTL SOCK_DGRAM +# define NETLIB_SOCK_TYPE SOCK_DGRAM # undef NETLIB_SOCK_PROTOCOL # define NETLIB_SOCK_PROTOCOL IPPROTO_ICMP6 # endif -#elif NETLIB_AF_FAMILY == AF_LOCAL +#elif NETLIB_SOCK_FAMILY == AF_LOCAL # if defined(CONFIG_NET_LOCAL_DGRAM) -# define NETLIB_SOCK_IOCTL SOCK_DGRAM +# define NETLIB_SOCK_TYPE SOCK_DGRAM # elif defined(CONFIG_NET_LOCAL_STREAM) -# define NETLIB_SOCK_IOCTL SOCK_STREAM +# define NETLIB_SOCK_TYPE SOCK_STREAM # endif -#elif NETLIB_AF_FAMILY == AF_PACKET -# define NETLIB_SOCK_IOCTL SOCK_RAW -#elif NETLIB_AF_FAMILY == AF_IEEE802154 -# define NETLIB_SOCK_IOCTL SOCK_DGRAM +#elif NETLIB_SOCK_FAMILY == AF_PACKET +# define NETLIB_SOCK_TYPE SOCK_RAW +#elif NETLIB_SOCK_FAMILY == AF_IEEE802154 +# define NETLIB_SOCK_TYPE SOCK_DGRAM #endif /**************************************************************************** diff --git a/netutils/netlib/netlib_autoconfig.c b/netutils/netlib/netlib_autoconfig.c index a73cce058..faed29c0e 100644 --- a/netutils/netlib/netlib_autoconfig.c +++ b/netutils/netlib/netlib_autoconfig.c @@ -80,7 +80,7 @@ int netlib_icmpv6_autoconfiguration(FAR const char *ifname) { /* Get an IPv6 socket */ - int sockfd = socket(PF_INET6, NETLIB_SOCK_IOCTL, 0); + int sockfd = socket(PF_INET6, NETLIB_SOCK_TYPE, 0); if (sockfd >= 0) { /* Create a request consisting only of the interface name */ diff --git a/netutils/netlib/netlib_delarp.c b/netutils/netlib/netlib_delarp.c index 5a4da1a88..4931d81d0 100644 --- a/netutils/netlib/netlib_delarp.c +++ b/netutils/netlib/netlib_delarp.c @@ -78,7 +78,7 @@ int netlib_del_arpmapping(FAR const struct sockaddr_in *inaddr) if (inaddr != NULL) { - int sockfd = socket(PF_INET, NETLIB_SOCK_IOCTL, 0); + int sockfd = socket(PF_INET, NETLIB_SOCK_TYPE, 0); if (sockfd >= 0) { struct arpreq req; diff --git a/netutils/netlib/netlib_getarp.c b/netutils/netlib/netlib_getarp.c index a3325cf06..38fb32a4b 100644 --- a/netutils/netlib/netlib_getarp.c +++ b/netutils/netlib/netlib_getarp.c @@ -81,7 +81,7 @@ int netlib_get_arpmapping(FAR const struct sockaddr_in *inaddr, if (inaddr != NULL && macaddr != NULL) { - int sockfd = socket(PF_INET, NETLIB_SOCK_IOCTL, 0); + int sockfd = socket(PF_INET, NETLIB_SOCK_TYPE, 0); if (sockfd >= 0) { struct arpreq req; diff --git a/netutils/netlib/netlib_getdripv4addr.c b/netutils/netlib/netlib_getdripv4addr.c index c71c6baea..5df23dc98 100644 --- a/netutils/netlib/netlib_getdripv4addr.c +++ b/netutils/netlib/netlib_getdripv4addr.c @@ -81,7 +81,7 @@ int netlib_get_dripv4addr(FAR const char *ifname, FAR struct in_addr *addr) if (ifname && addr) { - int sockfd = socket(PF_INET, NETLIB_SOCK_IOCTL, 0); + int sockfd = socket(PF_INET, NETLIB_SOCK_TYPE, 0); if (sockfd >= 0) { struct ifreq req; diff --git a/netutils/netlib/netlib_getessid.c b/netutils/netlib/netlib_getessid.c index 0950f2b6c..db6e6be1b 100644 --- a/netutils/netlib/netlib_getessid.c +++ b/netutils/netlib/netlib_getessid.c @@ -104,7 +104,7 @@ int netlib_getessid(FAR const char *ifname, FAR char *essid, size_t idlen) { /* Get a socket (only so that we get access to the INET subsystem) */ - int sockfd = socket(PF_FAMILY, NETLIB_SOCK_IOCTL, 0); + int sockfd = socket(PF_FAMILY, NETLIB_SOCK_TYPE, 0); if (sockfd >= 0) { struct iwreq req; diff --git a/netutils/netlib/netlib_getifstatus.c b/netutils/netlib/netlib_getifstatus.c index f3c0b6f0c..e11946ba0 100644 --- a/netutils/netlib/netlib_getifstatus.c +++ b/netutils/netlib/netlib_getifstatus.c @@ -101,7 +101,7 @@ int netlib_getifstatus(FAR const char *ifname, FAR uint8_t *flags) { /* Get a socket (only so that we get access to the INET subsystem) */ - int sockfd = socket(AF_FAMILY, NETLIB_SOCK_IOCTL, 0); + int sockfd = socket(AF_FAMILY, NETLIB_SOCK_TYPE, 0); if (sockfd >= 0) { struct ifreq req; diff --git a/netutils/netlib/netlib_getipv4addr.c b/netutils/netlib/netlib_getipv4addr.c index c60aa856e..2a78e8634 100644 --- a/netutils/netlib/netlib_getipv4addr.c +++ b/netutils/netlib/netlib_getipv4addr.c @@ -81,7 +81,7 @@ int netlib_get_ipv4addr(FAR const char *ifname, FAR struct in_addr *addr) if (ifname && addr) { - int sockfd = socket(PF_INET, NETLIB_SOCK_IOCTL, 0); + int sockfd = socket(PF_INET, NETLIB_SOCK_TYPE, 0); if (sockfd >= 0) { struct ifreq req; diff --git a/netutils/netlib/netlib_getipv4netmask.c b/netutils/netlib/netlib_getipv4netmask.c index 3c9769381..1c1252919 100644 --- a/netutils/netlib/netlib_getipv4netmask.c +++ b/netutils/netlib/netlib_getipv4netmask.c @@ -81,7 +81,7 @@ int netlib_get_ipv4netmask(FAR const char *ifname, FAR struct in_addr *addr) if (ifname && addr) { - int sockfd = socket(PF_INET, NETLIB_SOCK_IOCTL, 0); + int sockfd = socket(PF_INET, NETLIB_SOCK_TYPE, 0); if (sockfd >= 0) { struct ifreq req; diff --git a/netutils/netlib/netlib_getipv6addr.c b/netutils/netlib/netlib_getipv6addr.c index ed770b52d..81de2cb7a 100644 --- a/netutils/netlib/netlib_getipv6addr.c +++ b/netutils/netlib/netlib_getipv6addr.c @@ -81,7 +81,7 @@ int netlib_get_ipv6addr(FAR const char *ifname, FAR struct in6_addr *addr) if (ifname && addr) { - int sockfd = socket(PF_INET6, NETLIB_SOCK_IOCTL, 0); + int sockfd = socket(PF_INET6, NETLIB_SOCK_TYPE, 0); if (sockfd >= 0) { struct lifreq req; diff --git a/netutils/netlib/netlib_getmacaddr.c b/netutils/netlib/netlib_getmacaddr.c index 119c2db39..ee1a24518 100644 --- a/netutils/netlib/netlib_getmacaddr.c +++ b/netutils/netlib/netlib_getmacaddr.c @@ -98,7 +98,7 @@ int netlib_getmacaddr(const char *ifname, uint8_t *macaddr) { /* Get a socket (only so that we get access to the INET subsystem) */ - int sockfd = socket(AF_FAMILY, NETLIB_SOCK_IOCTL, 0); + int sockfd = socket(AF_FAMILY, NETLIB_SOCK_TYPE, 0); if (sockfd >= 0) { struct ifreq req; diff --git a/netutils/netlib/netlib_getnodeaddr.c b/netutils/netlib/netlib_getnodeaddr.c index cd65a83c0..e70f9ad23 100644 --- a/netutils/netlib/netlib_getnodeaddr.c +++ b/netutils/netlib/netlib_getnodeaddr.c @@ -83,7 +83,7 @@ int netlib_getnodnodeaddr(FAR const char *ifname, { /* Get a socket (only so that we get access to the INET subsystem) */ - int sockfd = socket(PF_INET6, NETLIB_SOCK_IOCTL, 0); + int sockfd = socket(PF_INET6, NETLIB_SOCK_TYPE, 0); if (sockfd >= 0) { /* Copy the network interface name */ diff --git a/netutils/netlib/netlib_getpanid.c b/netutils/netlib/netlib_getpanid.c index c5b889b1f..218fb69e3 100644 --- a/netutils/netlib/netlib_getpanid.c +++ b/netutils/netlib/netlib_getpanid.c @@ -83,7 +83,7 @@ int netlib_getpanid(FAR const char *ifname, FAR uint8_t *panid) { /* Get a socket (only so that we get access to the INET subsystem) */ - int sockfd = socket(PF_INET6, NETLIB_SOCK_IOCTL, 0); + int sockfd = socket(PF_INET6, NETLIB_SOCK_TYPE, 0); if (sockfd >= 0) { /* Perform the IOCTL */ diff --git a/netutils/netlib/netlib_getproperties.c b/netutils/netlib/netlib_getproperties.c index 80d9ca7d0..a86934421 100644 --- a/netutils/netlib/netlib_getproperties.c +++ b/netutils/netlib/netlib_getproperties.c @@ -83,7 +83,7 @@ int netlib_getproperties(FAR const char *ifname, { /* Get a socket (only so that we get access to the INET subsystem) */ - int sockfd = socket(PF_INET6, NETLIB_SOCK_IOCTL, 0); + int sockfd = socket(PF_INET6, NETLIB_SOCK_TYPE, 0); if (sockfd >= 0) { /* Copy the network interface name */ diff --git a/netutils/netlib/netlib_ipmsfilter.c b/netutils/netlib/netlib_ipmsfilter.c index 7871849e8..fc5e51dfd 100644 --- a/netutils/netlib/netlib_ipmsfilter.c +++ b/netutils/netlib/netlib_ipmsfilter.c @@ -90,7 +90,7 @@ int ipmsfilter(FAR const char *ifname, FAR const struct in_addr *multiaddr, { /* Get a socket (only so that we get access to the INET subsystem) */ - int sockfd = socket(PF_INET, NETLIB_SOCK_IOCTL, 0); + int sockfd = socket(PF_INET, NETLIB_SOCK_TYPE, 0); if (sockfd >= 0) { struct ip_msfilter imsf; diff --git a/netutils/netlib/netlib_ipv4adaptor.c b/netutils/netlib/netlib_ipv4adaptor.c index aa4d05b24..8b99ec2c3 100644 --- a/netutils/netlib/netlib_ipv4adaptor.c +++ b/netutils/netlib/netlib_ipv4adaptor.c @@ -107,7 +107,7 @@ static int _netlib_ipv4adaptor(in_addr_t destipaddr, FAR in_addr_t *srcipaddr) ifc.ifc_req = NULL; ifc.ifc_len = 0; - sd = socket(AF_INET, NETLIB_SOCK_IOCTL, 0); + sd = socket(AF_INET, NETLIB_SOCK_TYPE, 0); if (sd < 0) { ret = -errno; diff --git a/netutils/netlib/netlib_ipv6adaptor.c b/netutils/netlib/netlib_ipv6adaptor.c index 0ba3f7f6a..aa734ce83 100644 --- a/netutils/netlib/netlib_ipv6adaptor.c +++ b/netutils/netlib/netlib_ipv6adaptor.c @@ -108,7 +108,7 @@ static int _netlib_ipv6adaptor(FAR const struct in6_addr *destipaddr, lifc.lifc_req = NULL; lifc.lifc_len = 0; - sd = socket(AF_INET6, NETLIB_SOCK_IOCTL, 0); + sd = socket(AF_INET6, NETLIB_SOCK_TYPE, 0); if (sd < 0) { ret = -errno; diff --git a/netutils/netlib/netlib_setarp.c b/netutils/netlib/netlib_setarp.c index 4211ca327..25c2f4e62 100644 --- a/netutils/netlib/netlib_setarp.c +++ b/netutils/netlib/netlib_setarp.c @@ -81,7 +81,7 @@ int netlib_set_arpmapping(FAR const struct sockaddr_in *inaddr, if (inaddr != NULL && macaddr != NULL) { - int sockfd = socket(PF_INET, NETLIB_SOCK_IOCTL, 0); + int sockfd = socket(PF_INET, NETLIB_SOCK_TYPE, 0); if (sockfd >= 0) { struct arpreq req; diff --git a/netutils/netlib/netlib_setdripv4addr.c b/netutils/netlib/netlib_setdripv4addr.c index aab85daa9..c0ee3c00e 100644 --- a/netutils/netlib/netlib_setdripv4addr.c +++ b/netutils/netlib/netlib_setdripv4addr.c @@ -78,7 +78,7 @@ int netlib_set_dripv4addr(FAR const char *ifname, if (ifname && addr) { - int sockfd = socket(PF_INET, NETLIB_SOCK_IOCTL, 0); + int sockfd = socket(PF_INET, NETLIB_SOCK_TYPE, 0); if (sockfd >= 0) { FAR struct sockaddr_in *inaddr; diff --git a/netutils/netlib/netlib_setdripv6addr.c b/netutils/netlib/netlib_setdripv6addr.c index 102d53373..0bb12eeef 100644 --- a/netutils/netlib/netlib_setdripv6addr.c +++ b/netutils/netlib/netlib_setdripv6addr.c @@ -78,7 +78,7 @@ int netlib_set_dripv6addr(FAR const char *ifname, if (ifname && addr) { - int sockfd = socket(PF_INET6, NETLIB_SOCK_IOCTL, 0); + int sockfd = socket(PF_INET6, NETLIB_SOCK_TYPE, 0); if (sockfd >= 0) { FAR struct sockaddr_in6 *inaddr; diff --git a/netutils/netlib/netlib_seteaddr.c b/netutils/netlib/netlib_seteaddr.c index 71ed0dcba..11e6c8881 100644 --- a/netutils/netlib/netlib_seteaddr.c +++ b/netutils/netlib/netlib_seteaddr.c @@ -83,7 +83,7 @@ int netlib_seteaddr(FAR const char *ifname, FAR const uint8_t *eaddr) { /* Get a socket (only so that we get access to the INET subsystem) */ - int sockfd = socket(PF_INET6, NETLIB_SOCK_IOCTL, 0); + int sockfd = socket(PF_INET6, NETLIB_SOCK_TYPE, 0); if (sockfd >= 0) { /* Perform the IOCTL */ diff --git a/netutils/netlib/netlib_setessid.c b/netutils/netlib/netlib_setessid.c index 94356ebbd..ac94ec245 100644 --- a/netutils/netlib/netlib_setessid.c +++ b/netutils/netlib/netlib_setessid.c @@ -103,7 +103,7 @@ int netlib_setessid(FAR const char *ifname, FAR const char *essid) { /* Get a socket (only so that we get access to the INET subsystem) */ - int sockfd = socket(PF_FAMILY, NETLIB_SOCK_IOCTL, 0); + int sockfd = socket(PF_FAMILY, NETLIB_SOCK_TYPE, 0); if (sockfd >= 0) { struct iwreq req; diff --git a/netutils/netlib/netlib_setifstatus.c b/netutils/netlib/netlib_setifstatus.c index fb40bda45..a8262dafc 100644 --- a/netutils/netlib/netlib_setifstatus.c +++ b/netutils/netlib/netlib_setifstatus.c @@ -99,7 +99,7 @@ int netlib_ifup(const char *ifname) { /* Get a socket (only so that we get access to the INET subsystem) */ - int sockfd = socket(AF_FAMILY, NETLIB_SOCK_IOCTL, 0); + int sockfd = socket(AF_FAMILY, NETLIB_SOCK_TYPE, 0); if (sockfd >= 0) { struct ifreq req; @@ -142,7 +142,7 @@ int netlib_ifdown(const char *ifname) { /* Get a socket (only so that we get access to the INET subsystem) */ - int sockfd = socket(AF_FAMILY, NETLIB_SOCK_IOCTL, 0); + int sockfd = socket(AF_FAMILY, NETLIB_SOCK_TYPE, 0); if (sockfd >= 0) { struct ifreq req; diff --git a/netutils/netlib/netlib_setipv4addr.c b/netutils/netlib/netlib_setipv4addr.c index 25bcfb2cb..6e23bfb1e 100644 --- a/netutils/netlib/netlib_setipv4addr.c +++ b/netutils/netlib/netlib_setipv4addr.c @@ -77,7 +77,7 @@ int netlib_set_ipv4addr(FAR const char *ifname, FAR const struct in_addr *addr) if (ifname && addr) { - int sockfd = socket(PF_INET, NETLIB_SOCK_IOCTL, 0); + int sockfd = socket(PF_INET, NETLIB_SOCK_TYPE, 0); if (sockfd >= 0) { FAR struct sockaddr_in *inaddr; diff --git a/netutils/netlib/netlib_setipv4netmask.c b/netutils/netlib/netlib_setipv4netmask.c index 07127537b..5f74737e9 100644 --- a/netutils/netlib/netlib_setipv4netmask.c +++ b/netutils/netlib/netlib_setipv4netmask.c @@ -77,7 +77,7 @@ int netlib_set_ipv4netmask(FAR const char *ifname, if (ifname && addr) { - int sockfd = socket(PF_INET, NETLIB_SOCK_IOCTL, 0); + int sockfd = socket(PF_INET, NETLIB_SOCK_TYPE, 0); if (sockfd >= 0) { FAR struct sockaddr_in *inaddr; diff --git a/netutils/netlib/netlib_setipv6addr.c b/netutils/netlib/netlib_setipv6addr.c index 3bda1b189..182c728aa 100644 --- a/netutils/netlib/netlib_setipv6addr.c +++ b/netutils/netlib/netlib_setipv6addr.c @@ -78,7 +78,7 @@ int netlib_set_ipv6addr(FAR const char *ifname, if (ifname && addr) { - int sockfd = socket(PF_INET6, NETLIB_SOCK_IOCTL, 0); + int sockfd = socket(PF_INET6, NETLIB_SOCK_TYPE, 0); if (sockfd >= 0) { FAR struct sockaddr_in6 *inaddr; diff --git a/netutils/netlib/netlib_setipv6netmask.c b/netutils/netlib/netlib_setipv6netmask.c index cfc05030f..f097a9999 100644 --- a/netutils/netlib/netlib_setipv6netmask.c +++ b/netutils/netlib/netlib_setipv6netmask.c @@ -77,7 +77,7 @@ int netlib_set_ipv6netmask(FAR const char *ifname, if (ifname && addr) { - int sockfd = socket(PF_INET6, NETLIB_SOCK_IOCTL, 0); + int sockfd = socket(PF_INET6, NETLIB_SOCK_TYPE, 0); if (sockfd >= 0) { FAR struct sockaddr_in6 *inaddr; diff --git a/netutils/netlib/netlib_setmacaddr.c b/netutils/netlib/netlib_setmacaddr.c index 4c2c06d07..3ef41c504 100644 --- a/netutils/netlib/netlib_setmacaddr.c +++ b/netutils/netlib/netlib_setmacaddr.c @@ -105,7 +105,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(PF_FAMILY, NETLIB_SOCK_IOCTL, 0); + int sockfd = socket(PF_FAMILY, NETLIB_SOCK_TYPE, 0); if (sockfd >= 0) { struct ifreq req; diff --git a/netutils/netlib/netlib_setnodeaddr.c b/netutils/netlib/netlib_setnodeaddr.c index 93813216d..ca316b07b 100644 --- a/netutils/netlib/netlib_setnodeaddr.c +++ b/netutils/netlib/netlib_setnodeaddr.c @@ -83,7 +83,7 @@ int netlib_setnodeaddr(FAR const char *ifname, { /* Get a socket (only so that we get access to the INET subsystem) */ - int sockfd = socket(PF_INET6, NETLIB_SOCK_IOCTL, 0); + int sockfd = socket(PF_INET6, NETLIB_SOCK_TYPE, 0); if (sockfd >= 0) { /* Copy the network interface name */