diff options
| author | Laurent Vivier <lvivier@redhat.com> | 2025-10-21 23:01:14 +0200 |
|---|---|---|
| committer | Stefano Brivio <sbrivio@redhat.com> | 2025-10-30 15:33:03 +0100 |
| commit | ca931248dc32bf284a2dee095d983621ab4bec7f (patch) | |
| tree | 502e97733a902d1ceaacd8d15522967dd8f17029 | |
| parent | dd5302dd7bf518aa2c50a9819ee06ea2d6fd0061 (diff) | |
| download | passt-ca931248dc32bf284a2dee095d983621ab4bec7f.tar passt-ca931248dc32bf284a2dee095d983621ab4bec7f.tar.gz passt-ca931248dc32bf284a2dee095d983621ab4bec7f.tar.bz2 passt-ca931248dc32bf284a2dee095d983621ab4bec7f.tar.lz passt-ca931248dc32bf284a2dee095d983621ab4bec7f.tar.xz passt-ca931248dc32bf284a2dee095d983621ab4bec7f.tar.zst passt-ca931248dc32bf284a2dee095d983621ab4bec7f.zip | |
icmp: Use epoll instance management for ICMP flows
Store the epoll id in the flow_common structure for ICMP ping flows
using flow_epollid_set() and retrieve the corresponding epoll
file descriptor with flow_epollfd() instead of passing c->epollfd
directly. This makes ICMP consistent with the recent TCP changes and
follows the pattern established in previous commit.
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-- | icmp.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -153,7 +153,7 @@ unexpected: static void icmp_ping_close(const struct ctx *c, const struct icmp_ping_flow *pingf) { - epoll_del(c->epollfd, pingf->sock); + epoll_del(flow_epollfd(&pingf->f), pingf->sock); close(pingf->sock); flow_hash_remove(c, FLOW_SIDX(pingf, INISIDE)); } @@ -210,11 +210,13 @@ static struct icmp_ping_flow *icmp_ping_new(const struct ctx *c, if (pingf->sock > FD_REF_MAX) goto cancel; + flow_epollid_set(&pingf->f, EPOLLFD_ID_DEFAULT); + ref.type = EPOLL_TYPE_PING; ref.flowside = FLOW_SIDX(flow, TGTSIDE); ref.fd = pingf->sock; - if (epoll_add(c->epollfd, EPOLLIN, ref) < 0) { + if (epoll_add(flow_epollfd(&pingf->f), EPOLLIN, ref) < 0) { close(pingf->sock); goto cancel; } |
