icmp/icmp6: fix errno forgot to add a negative sign

otherwise, errors cannot be returned correctly

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
This commit is contained in:
zhanghongyu 2025-02-13 22:33:18 +08:00 • committed by Xiang Xiao
parent 82f4b2cbad
commit e0d3af4b41
2 changed files with 4 additions and 4 deletions

View file

@ -321,7 +321,7 @@ static int icmp_getsockopt_internal(FAR struct socket *psock, int option,
if (psock->s_type != SOCK_RAW)
{
return ENOPROTOOPT;
return -ENOPROTOOPT;
}
net_lock();
@ -429,7 +429,7 @@ static int icmp_setsockopt_internal(FAR struct socket *psock, int option,
if (psock->s_type != SOCK_RAW)
{
return ENOPROTOOPT;
return -ENOPROTOOPT;
}
net_lock();

View file

@ -319,7 +319,7 @@ static int icmpv6_getsockopt_internal(FAR struct socket *psock, int option,
if (psock->s_type != SOCK_RAW)
{
return ENOPROTOOPT;
return -ENOPROTOOPT;
}
net_lock();
@ -427,7 +427,7 @@ static int icmpv6_setsockopt_internal(FAR struct socket *psock, int option,
if (psock->s_type != SOCK_RAW)
{
return ENOPROTOOPT;
return -ENOPROTOOPT;
}
net_lock();