diff options
| author | Laurent Vivier <lvivier@redhat.com> | 2025-12-18 15:57:24 +0100 |
|---|---|---|
| committer | Stefano Brivio <sbrivio@redhat.com> | 2025-12-23 15:25:14 +0100 |
| commit | 2ba9fd58183cd1d6e01c9b95a1fd433f2e7da42a (patch) | |
| tree | c45eb592633af1e7500692acbcdcc4fc11f4716d | |
| parent | 6292845bfed92c618480d58dae5cf9d045918191 (diff) | |
| download | passt-2ba9fd58183cd1d6e01c9b95a1fd433f2e7da42a.tar passt-2ba9fd58183cd1d6e01c9b95a1fd433f2e7da42a.tar.gz passt-2ba9fd58183cd1d6e01c9b95a1fd433f2e7da42a.tar.bz2 passt-2ba9fd58183cd1d6e01c9b95a1fd433f2e7da42a.tar.lz passt-2ba9fd58183cd1d6e01c9b95a1fd433f2e7da42a.tar.xz passt-2ba9fd58183cd1d6e01c9b95a1fd433f2e7da42a.tar.zst passt-2ba9fd58183cd1d6e01c9b95a1fd433f2e7da42a.zip | |
tcp: Update EPOLL_TYPE_TCP_TIMER fdHEAD2025_12_23.2ba9fd5master
For consistency with other epoll events, set the fd field to the file
descriptor actually added by epoll_ctl() (conn->timer), rather than
conn->sock.
This is a no-op change as ref.fd is not currently used in
tcp_timer_handler().
Signed-off-by: Laurent Vivier <lvivier@redhat.com>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
| -rw-r--r-- | tcp.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -554,7 +554,7 @@ static int tcp_epoll_ctl(const struct ctx *c, struct tcp_tap_conn *conn) if (conn->timer != -1) { union epoll_ref ref_t = { .type = EPOLL_TYPE_TCP_TIMER, - .fd = conn->sock, + .fd = conn->timer, .flow = FLOW_IDX(conn) }; struct epoll_event ev_t = { .data.u64 = ref_t.u64, .events = EPOLLIN | EPOLLET }; @@ -582,7 +582,6 @@ static void tcp_timer_ctl(const struct ctx *c, struct tcp_tap_conn *conn) if (conn->timer == -1) { union epoll_ref ref = { .type = EPOLL_TYPE_TCP_TIMER, - .fd = conn->sock, .flow = FLOW_IDX(conn) }; struct epoll_event ev = { .data.u64 = ref.u64, .events = EPOLLIN | EPOLLET }; @@ -598,6 +597,7 @@ static void tcp_timer_ctl(const struct ctx *c, struct tcp_tap_conn *conn) return; } conn->timer = fd; + ref.fd = conn->timer; if (epoll_ctl(epollfd, EPOLL_CTL_ADD, conn->timer, &ev)) { flow_dbg_perror(conn, "failed to add timer"); |
