Update UDP flow handling to use the epollfd field from the flow_common
structure instead of accessing it from the context. This aligns UDP with
the recent changes to TCP and ICMP flow management.
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 f99994523a6c..9843b9f5fb2f 100644
--- a/udp_flow.c
+++ b/udp_flow.c
@@ -51,7 +51,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(uflow->f.epollfd, uflow->s[sidei]);
close(uflow->s[sidei]);
uflow->s[sidei] = -1;
}
@@ -91,9 +91,11 @@ static int udp_flow_sock(const struct ctx *c,
ref.data = fref.data;
ref.fd = s;
+ uflow->f.epollfd = c->epollfd;
+
ev.events = EPOLLIN;
ev.data.u64 = ref.u64;
- if (epoll_ctl(c->epollfd, EPOLL_CTL_ADD, s, &ev) == -1) {
+ if (epoll_ctl(uflow->f.epollfd, EPOLL_CTL_ADD, s, &ev) == -1) {
int rc = -errno;
close(s);
warn("L4 epoll_ctl: %s", strerror_(-rc));
@@ -103,7 +105,7 @@ static int udp_flow_sock(const struct ctx *c,
if (flowside_connect(c, s, pif, side) < 0) {
int rc = -errno;
- epoll_del(c->epollfd, s);
+ epoll_del(uflow->f.epollfd, s);
close(s);
flow_dbg_perror(uflow, "Couldn't connect flow socket");
--
2.50.1