net/usersock: Return -ENOSUPP directly if domain isn't equal to PF_INET/PF_INET6

regression by https://github.com/apache/nuttx/pull/9647

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
Xiang Xiao 2023-10-09 14:13:30 +08:00 committed by Alan Carvalho de Assis
parent e0e6e5c2c8
commit 21beb284bc

View File

@ -100,6 +100,11 @@ static int usrsock_sockif_setup(FAR struct socket *psock)
{
int ret;
if (psock->s_domain != PF_INET && psock->s_domain != PF_INET6)
{
return -ENOTSUP; /* Only ipv4 and ipv6 support the offload */
};
/* Let the user socket logic handle the setup...
*
* A return value of zero means that the operation was