aboutgitcodebugslistschat
path: root/tcp.c
diff options
context:
space:
mode:
Diffstat (limited to 'tcp.c')
-rw-r--r--tcp.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/tcp.c b/tcp.c
index 77c62f0..7b3376f 100644
--- a/tcp.c
+++ b/tcp.c
@@ -424,23 +424,27 @@ int tcp_set_peek_offset(int s, int offset)
*/
static uint32_t tcp_conn_epoll_events(uint8_t events, uint8_t conn_flags)
{
+ uint32_t rdhup;
+
if (!events)
return 0;
+ rdhup = (events & SOCK_FIN_RCVD) ? 0 : EPOLLRDHUP;
+
if (events & ESTABLISHED) {
if (events & TAP_FIN_SENT)
return EPOLLET;
if (conn_flags & STALLED)
- return EPOLLIN | EPOLLOUT | EPOLLRDHUP | EPOLLET;
+ return EPOLLIN | EPOLLOUT | rdhup | EPOLLET;
- return EPOLLIN | EPOLLRDHUP;
+ return EPOLLIN | rdhup;
}
if (events == TAP_SYN_RCVD)
- return EPOLLOUT | EPOLLET | EPOLLRDHUP;
+ return EPOLLOUT | EPOLLET | rdhup;
- return EPOLLRDHUP;
+ return rdhup;
}
/**