diff options
author | Stefano Brivio <sbrivio@redhat.com> | 2021-05-21 11:14:42 +0200 |
---|---|---|
committer | Stefano Brivio <sbrivio@redhat.com> | 2021-05-21 11:14:42 +0200 |
commit | 7e3e36b2c2d6cc233958aa10da8ef703c693f0b9 (patch) | |
tree | c2601701cdc02534d0630385dcac7b39cc1f159f | |
parent | 8358400b3f42920bdd437a7aeecbfdefb45ac0a1 (diff) | |
download | passt-7e3e36b2c2d6cc233958aa10da8ef703c693f0b9.tar passt-7e3e36b2c2d6cc233958aa10da8ef703c693f0b9.tar.gz passt-7e3e36b2c2d6cc233958aa10da8ef703c693f0b9.tar.bz2 passt-7e3e36b2c2d6cc233958aa10da8ef703c693f0b9.tar.lz passt-7e3e36b2c2d6cc233958aa10da8ef703c693f0b9.tar.xz passt-7e3e36b2c2d6cc233958aa10da8ef703c693f0b9.tar.zst passt-7e3e36b2c2d6cc233958aa10da8ef703c693f0b9.zip |
tcp: Close socket on EPOLLHUP or EPOLLRDHUP in non-data state
If the peer doesn't shut down orderly, this might happen: just close
the socket then.
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
-rw-r--r-- | tcp.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -1465,6 +1465,8 @@ void tcp_sock_handler(struct ctx *c, int s, uint32_t events, char *pkt_buf, tcp_data_from_sock(c, s, now); tcp_send_to_tap(c, s, FIN | ACK, NULL, 0); tcp_sock_consume(s, tc[s].seq_ack_from_tap); + } else { + tcp_close_and_epoll_del(c, s); } } } |