aboutgitcodebugslistschat
diff options
context:
space:
mode:
-rw-r--r--flow.c7
-rw-r--r--tcp_splice.c4
2 files changed, 8 insertions, 3 deletions
diff --git a/flow.c b/flow.c
index 8d72965..4f53486 100644
--- a/flow.c
+++ b/flow.c
@@ -359,7 +359,12 @@ bool flow_in_epoll(const struct flow_common *f)
*/
int flow_epollfd(const struct flow_common *f)
{
- ASSERT(f->epollid < EPOLLFD_ID_MAX);
+ if (f->epollid >= EPOLLFD_ID_MAX) {
+ flow_log_(f, true, LOG_WARNING,
+ "Invalid epollid %i for flow, assuming default",
+ f->epollid);
+ return epoll_id_to_fd[EPOLLFD_ID_DEFAULT];
+ }
return epoll_id_to_fd[f->epollid];
}
diff --git a/tcp_splice.c b/tcp_splice.c
index 717766a..4405224 100644
--- a/tcp_splice.c
+++ b/tcp_splice.c
@@ -381,14 +381,14 @@ static int tcp_splice_connect(const struct ctx *c, struct tcp_splice_conn *conn)
pif_sockaddr(c, &sa, tgtpif, &tgt->eaddr, tgt->eport);
+ conn_event(c, conn, SPLICE_CONNECT);
+
if (connect(conn->s[1], &sa.sa, socklen_inany(&sa))) {
if (errno != EINPROGRESS) {
flow_trace(conn, "Couldn't connect socket for splice: %s",
strerror_(errno));
return -errno;
}
-
- conn_event(c, conn, SPLICE_CONNECT);
} else {
conn_event(c, conn, SPLICE_ESTABLISHED);
return tcp_splice_connect_finish(c, conn);