mirror of
https://github.com/apache/nuttx.git
synced 2026-05-21 04:52:02 +08:00
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:
@@ -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();
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user