mirror of
https://passt.top/passt
synced 2024-10-04 13:05:47 +00:00
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>
This commit is contained in:
parent
8358400b3f
commit
7e3e36b2c2
2
tcp.c
2
tcp.c
@ -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_data_from_sock(c, s, now);
|
||||||
tcp_send_to_tap(c, s, FIN | ACK, NULL, 0);
|
tcp_send_to_tap(c, s, FIN | ACK, NULL, 0);
|
||||||
tcp_sock_consume(s, tc[s].seq_ack_from_tap);
|
tcp_sock_consume(s, tc[s].seq_ack_from_tap);
|
||||||
|
} else {
|
||||||
|
tcp_close_and_epoll_del(c, s);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user