diff --git a/net/inet/ipv4_setsockopt.c b/net/inet/ipv4_setsockopt.c index 23e756b7486..5cfc853a096 100644 --- a/net/inet/ipv4_setsockopt.c +++ b/net/inet/ipv4_setsockopt.c @@ -195,7 +195,7 @@ int ipv4_setsockopt(FAR struct socket *psock, int option, ttl = (value_len >= sizeof(int)) ? *(FAR int *)value : (int)*(FAR unsigned char *)value; - if (ttl <= 0 || ttl > 255) + if (ttl < 0 || ttl > 255) { ret = -EINVAL; }