On Tue, Oct 21, 2025 at 11:01:15PM +0200, Laurent Vivier wrote: > Store the epoll id in the flow_common structure for UDP flows using > flow_epollid_set() and retrieve the corresponding epoll file descriptor > with flow_epollfd() instead of passing c->epollfd directly. This makes > UDP consistent with the recent TCP and ICMP changes. > > Signed-off-by: Laurent Vivier Reviewed-by: David Gibson > --- > udp_flow.c | 8 +++++--- > 1 file changed, 5 insertions(+), 3 deletions(-) > > diff --git a/udp_flow.c b/udp_flow.c > index 00e231fe1b01..8907f2f72741 100644 > --- a/udp_flow.c > +++ b/udp_flow.c > @@ -52,7 +52,7 @@ void udp_flow_close(const struct ctx *c, struct udp_flow *uflow) > flow_foreach_sidei(sidei) { > flow_hash_remove(c, FLOW_SIDX(uflow, sidei)); > if (uflow->s[sidei] >= 0) { > - epoll_del(c->epollfd, uflow->s[sidei]); > + epoll_del(flow_epollfd(&uflow->f), uflow->s[sidei]); > close(uflow->s[sidei]); > uflow->s[sidei] = -1; > } > @@ -92,7 +92,9 @@ static int udp_flow_sock(const struct ctx *c, > ref.data = fref.data; > ref.fd = s; > > - rc = epoll_add(c->epollfd, EPOLLIN, ref); > + flow_epollid_set(&uflow->f, EPOLLFD_ID_DEFAULT); > + > + rc = epoll_add(flow_epollfd(&uflow->f), EPOLLIN, ref); > if (rc < 0) { > close(s); > return rc; > @@ -101,7 +103,7 @@ static int udp_flow_sock(const struct ctx *c, > if (flowside_connect(c, s, pif, side) < 0) { > rc = -errno; > > - epoll_del(c->epollfd, s); > + epoll_del(flow_epollfd(&uflow->f), s); > close(s); > > flow_dbg_perror(uflow, "Couldn't connect flow socket"); > -- > 2.51.0 > -- David Gibson (he or they) | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you, not the other way | around. http://www.ozlabs.org/~dgibson