net: Make si_listen callback optional

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
Xiang Xiao
2023-03-06 20:58:27 +02:00
committed by Petro Karashchenko
parent 2553b7701c
commit a97e2523a4
9 changed files with 17 additions and 262 deletions
+6 -1
View File
@@ -82,7 +82,12 @@ int psock_listen(FAR struct socket *psock, int backlog)
/* Let the address family's listen() method handle the operation */
DEBUGASSERT(psock->s_sockif != NULL && psock->s_sockif->si_listen != NULL);
DEBUGASSERT(psock->s_sockif != NULL);
if (psock->s_sockif->si_listen == NULL)
{
return -EOPNOTSUPP;
}
ret = psock->s_sockif->si_listen(psock, backlog);
if (ret >= 0)
{