Skip to content

Commit 379aece

Browse files
authored
[components][sal]delay getting sal_proto_family in sal_ioctlsocket
1 parent 3ca6126 commit 379aece

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

components/net/sal/src/sal_socket.c

+5-4
Original file line numberDiff line numberDiff line change
@@ -1166,12 +1166,9 @@ int sal_ioctlsocket(int socket, long cmd, void *arg)
11661166
/* get the socket object by socket descriptor */
11671167
SAL_SOCKET_OBJ_GET(sock, socket);
11681168

1169-
/* check the network interface socket opreation */
1170-
SAL_NETDEV_SOCKETOPS_VALID(sock->netdev, pf, ioctlsocket);
1171-
11721169
struct sal_ifreq *ifr = (struct sal_ifreq *)arg;
11731170

1174-
if((sock->domain == AF_INET)&&(sock->netdev)&&(ifr != RT_NULL))
1171+
if (ifr != RT_NULL)
11751172
{
11761173
switch (cmd)
11771174
{
@@ -1473,6 +1470,10 @@ int sal_ioctlsocket(int socket, long cmd, void *arg)
14731470
break;
14741471
}
14751472
}
1473+
1474+
/* check the network interface socket opreation */
1475+
SAL_NETDEV_SOCKETOPS_VALID(sock->netdev, pf, ioctlsocket);
1476+
14761477
return pf->skt_ops->ioctlsocket((int)(size_t)sock->user_data, cmd, arg);
14771478
}
14781479

0 commit comments

Comments
 (0)