mirror of
https://github.com/apache/nuttx.git
synced 2026-10-03 20:27:53 +00: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:
parent
82f4b2cbad
commit
e0d3af4b41
2 changed files with 4 additions and 4 deletions
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue