From b0ac97adab0d81d481805ac9e47e72ee5d0282cf Mon Sep 17 00:00:00 2001 From: "chao.an" Date: Mon, 10 May 2021 18:02:32 +0800 Subject: [PATCH] net/icmp: fix invalid condition comparison up_assert: Assertion failed at file: icmp/icmp_recvmsg.c line: 175 task: net_tasklet Signed-off-by: chao.an --- net/icmp/icmp_recvmsg.c | 2 +- net/icmpv6/icmpv6_recvmsg.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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 */