diff options
author | Stefano Brivio <sbrivio@redhat.com> | 2021-09-16 08:41:19 +0200 |
---|---|---|
committer | Stefano Brivio <sbrivio@redhat.com> | 2021-09-16 08:50:02 +0200 |
commit | 62bace390b34c00e37323fdddb05b3c79eaa4242 (patch) | |
tree | 6bfc287fe201e4361d6bc43558a687e5211f37da | |
parent | 492b58d64b5b6419f6627b609927de2991c58d56 (diff) | |
download | passt-62bace390b34c00e37323fdddb05b3c79eaa4242.tar passt-62bace390b34c00e37323fdddb05b3c79eaa4242.tar.gz passt-62bace390b34c00e37323fdddb05b3c79eaa4242.tar.bz2 passt-62bace390b34c00e37323fdddb05b3c79eaa4242.tar.lz passt-62bace390b34c00e37323fdddb05b3c79eaa4242.tar.xz passt-62bace390b34c00e37323fdddb05b3c79eaa4242.tar.zst passt-62bace390b34c00e37323fdddb05b3c79eaa4242.zip |
pasta, tcp: Mask EPOLLIN and EPOLLRDHUP after sending FIN
Now that we dropped EPOLLET, we'll keep getting EPOLLRDHUP, and
possibly EPOLLIN, even if there's nothing to read anymore.
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
-rw-r--r-- | tcp.c | 16 |
1 files changed, 14 insertions, 2 deletions
@@ -2735,8 +2735,14 @@ eintr: if (move_from == conn->from && conn->from_read == conn->from_written) { if (!conn->from_fin_sent) { - shutdown(move_to, SHUT_WR); + shutdown(conn->to, SHUT_WR); conn->from_fin_sent = 1; + + ev.events = 0; + ref.s = move_from; + ev.data.u64 = ref.u64, + epoll_ctl(c->epollfd, EPOLL_CTL_MOD, + move_from, &ev); } if (conn->to_fin_sent) @@ -2744,8 +2750,14 @@ eintr: } else if (move_from == conn->to && conn->to_read == conn->to_written) { if (!conn->to_fin_sent) { - shutdown(move_to, SHUT_WR); + shutdown(conn->from, SHUT_WR); conn->to_fin_sent = 1; + + ev.events = 0; + ref.s = move_from; + ev.data.u64 = ref.u64, + epoll_ctl(c->epollfd, EPOLL_CTL_MOD, + move_from, &ev); } if (conn->from_fin_sent) |