diff --git a/net/icmp/icmp_sockif.c b/net/icmp/icmp_sockif.c index e903a55c3a8..5aedef1b2c6 100644 --- a/net/icmp/icmp_sockif.c +++ b/net/icmp/icmp_sockif.c @@ -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(); diff --git a/net/icmpv6/icmpv6_sockif.c b/net/icmpv6/icmpv6_sockif.c index 057829dc66c..e38ee9eb9bd 100644 --- a/net/icmpv6/icmpv6_sockif.c +++ b/net/icmpv6/icmpv6_sockif.c @@ -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();