File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
components/net/sal_socket/src Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -309,12 +309,13 @@ struct sal_socket *sal_get_socket(int socket)
309309{
310310 struct sal_socket_table * st = & socket_table ;
311311
312+ socket = socket - SAL_SOCKET_OFFSET ;
313+
312314 if (socket < 0 || socket >= (int ) st -> max_socket )
313315 {
314316 return RT_NULL ;
315317 }
316318
317- socket = socket - SAL_SOCKET_OFFSET ;
318319 /* check socket structure valid or not */
319320 RT_ASSERT (st -> sockets [socket ]-> magic == SAL_SOCKET_MAGIC );
320321
@@ -975,7 +976,7 @@ int sal_closesocket(int socket)
975976
976977 /* clsoesocket operation not need to vaild network interface status */
977978 /* valid the network interface socket opreation */
978- SAL_NETDEV_SOCKETOPS_VALID (sock -> netdev , pf , socket );
979+ SAL_NETDEV_SOCKETOPS_VALID (sock -> netdev , pf , closesocket );
979980
980981 if (pf -> skt_ops -> closesocket ((int ) sock -> user_data ) == 0 )
981982 {
You can’t perform that action at this time.
0 commit comments