]> git.baikalelectronics.ru Git - kernel.git/commit
tcp: handle pure FIN case correctly
authorCong Wang <cong.wang@bytedance.com>
Wed, 17 Aug 2022 19:54:45 +0000 (12:54 -0700)
committerJakub Kicinski <kuba@kernel.org>
Thu, 18 Aug 2022 18:04:56 +0000 (11:04 -0700)
commit82b0e6bda12889a549748af9c99b9c448db5e847
tree7378084ad03e9513090482684a21c6e810d61b36
parent85748c26880ca202319fd418600fc1840eb1c5da
tcp: handle pure FIN case correctly

When skb->len==0, the recv_actor() returns 0 too, but we also use 0
for error conditions. This patch amends this by propagating the errors
to tcp_read_skb() so that we can distinguish skb->len==0 case from
error cases.

Fixes: 5b1c8052b4a6 ("tcp: Introduce tcp_read_skb()")
Reported-by: Eric Dumazet <edumazet@google.com>
Cc: John Fastabend <john.fastabend@gmail.com>
Cc: Jakub Sitnicki <jakub@cloudflare.com>
Signed-off-by: Cong Wang <cong.wang@bytedance.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/core/skmsg.c
net/ipv4/tcp.c