]> git.baikalelectronics.ru Git - kernel.git/commit
tcp: fix signed/unsigned comparison
authorEric Dumazet <edumazet@google.com>
Sun, 17 Apr 2022 18:34:32 +0000 (11:34 -0700)
committerDavid S. Miller <davem@davemloft.net>
Mon, 18 Apr 2022 09:28:40 +0000 (10:28 +0100)
commit54ab3ecea2a977364d63ead47ca6df0f9cf35ae1
tree90d7a5df0d50c275334fa252a132ab1d9e2a295f
parent34811ea723ecdeff109c2446307c5f6970185482
tcp: fix signed/unsigned comparison

Kernel test robot reported:

smatch warnings:
net/ipv4/tcp_input.c:5966 tcp_rcv_established() warn: unsigned 'reason' is never less than zero.

I actually had one packetdrill failing because of this bug,
and was about to send the fix :)

v2: Andreas Schwab also pointed out that @reason needs to be negated
    before we reach tcp_drop_reason()

Fixes: 8a1ecee1f087 ("tcp: add two drop reasons for tcp_ack()")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Andreas Schwab <schwab@linux-m68k.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/tcp_input.c