diff options
| author | zms123456 <[email protected]> | 2024-09-15 01:52:40 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2024-09-14 13:52:40 -0400 |
| commit | 379aece6dc0ba2bc74c3e6548010df8017cf5359 (patch) | |
| tree | 4a86932e6fb3b82a8d1d7d404f0614130c3750ea /components/net/sal | |
| parent | 3ca6126efc1bde098312c2886c2332caa6a32126 (diff) | |
[components][sal]delay getting sal_proto_family in sal_ioctlsocket
Diffstat (limited to 'components/net/sal')
| -rw-r--r-- | components/net/sal/src/sal_socket.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/components/net/sal/src/sal_socket.c b/components/net/sal/src/sal_socket.c index aebf8d5ff1..a268c2dceb 100644 --- a/components/net/sal/src/sal_socket.c +++ b/components/net/sal/src/sal_socket.c @@ -1166,12 +1166,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) { @@ -1473,6 +1470,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); } |
