diff --git a/net/icmp/icmp_recvmsg.c b/net/icmp/icmp_recvmsg.c index 27e6cc284d..80c1ab88d3 100644 --- a/net/icmp/icmp_recvmsg.c +++ b/net/icmp/icmp_recvmsg.c @@ -162,7 +162,7 @@ static uint16_t recvfrom_eventhandler(FAR struct net_driver_s *dev, /* Return the size of the returned data */ - DEBUGASSERT(recvsize > INT16_MAX); + DEBUGASSERT(recvsize <= INT16_MAX); pstate->recv_result = recvsize; /* Return the IPv4 address of the sender from the IPv4 header */ diff --git a/net/icmpv6/icmpv6_recvmsg.c b/net/icmpv6/icmpv6_recvmsg.c index fe2539f3db..b4fb7c80d2 100644 --- a/net/icmpv6/icmpv6_recvmsg.c +++ b/net/icmpv6/icmpv6_recvmsg.c @@ -169,7 +169,7 @@ static uint16_t recvfrom_eventhandler(FAR struct net_driver_s *dev, /* Return the size of the returned data */ - DEBUGASSERT(recvsize > INT16_MAX); + DEBUGASSERT(recvsize <= INT16_MAX); pstate->recv_result = recvsize; /* Return the IPv6 address of the sender from the IPv6 header */