optimize sal_bind

This commit is contained in:
zhao maosheng 2024-09-10 16:21:19 +08:00 committed by Rbb666
parent 3d503e931b
commit 992e79a0f8
1 changed files with 2 additions and 1 deletions

View File

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