Skip to content

Commit

Permalink
delay getting sal_proto_family in sal_ioctlsocket
Browse files Browse the repository at this point in the history
  • Loading branch information
zmshahaha committed Sep 12, 2024
1 parent d2160d3 commit b4231c8
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions components/net/sal/src/sal_socket.c
Original file line number Diff line number Diff line change
Expand Up @@ -1171,12 +1171,9 @@ int sal_ioctlsocket(int socket, long cmd, void *arg)
/* get the socket object by socket descriptor */
SAL_SOCKET_OBJ_GET(sock, socket);

/* check the network interface socket opreation */
SAL_NETDEV_SOCKETOPS_VALID(sock->netdev, pf, ioctlsocket);

struct sal_ifreq *ifr = (struct sal_ifreq *)arg;

if((sock->domain == AF_INET)&&(sock->netdev)&&(ifr != RT_NULL))
if (ifr != RT_NULL)
{
switch (cmd)
{
Expand Down Expand Up @@ -1478,6 +1475,10 @@ int sal_ioctlsocket(int socket, long cmd, void *arg)
break;
}
}

/* check the network interface socket opreation */
SAL_NETDEV_SOCKETOPS_VALID(sock->netdev, pf, ioctlsocket);

return pf->skt_ops->ioctlsocket((int)(size_t)sock->user_data, cmd, arg);
}

Expand Down

0 comments on commit b4231c8

Please sign in to comment.