Store the thread number in the flow_common structure for UDP
flows using flow_epollfd_set() and retrieve the corresponding epoll
file descriptor with flow_epollfd_get() instead of passing c->epollfd
directly. This makes UDP consistent with the recent TCP and ICMP
changes.
Signed-off-by: Laurent Vivier
---
udp_flow.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/udp_flow.c b/udp_flow.c
index caaf3dababb1..7f6d88d37259 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_get(&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_epollfd_set(&uflow->f, 0, c->epollfd);
+
+ rc = epoll_add(flow_epollfd_get(&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_get(&uflow->f), s);
close(s);
flow_dbg_perror(uflow, "Couldn't connect flow socket");
--
2.50.1