Skip to content

Commit

Permalink
optimize sal_bind
Browse files Browse the repository at this point in the history
  • Loading branch information
zmshahaha authored and Rbb666 committed Sep 19, 2024
1 parent 3d503e9 commit 992e79a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion components/net/sal/src/sal_socket.c
Original file line number Diff line number Diff line change
Expand Up @@ -679,7 +679,8 @@ int sal_bind(int socket, const struct sockaddr *name, socklen_t namelen)

addr_un = (struct sockaddr_un *)name;

if ((addr_un->sa_family != AF_UNIX) && (addr_un->sa_family != AF_NETLINK))
#define IS_INET_ADDR_FAMILY(_af) ((_af) == AF_INET) || ((_af) == AF_INET6)
if (IS_INET_ADDR_FAMILY(name->sa_family))
{
/* bind network interface by ip address */
sal_sockaddr_to_ipaddr(name, &input_ipaddr);
Expand Down

0 comments on commit 992e79a

Please sign in to comment.