diff options
| author | Laurent Vivier <lvivier@redhat.com> | 2026-01-09 17:54:35 +0100 |
|---|---|---|
| committer | Stefano Brivio <sbrivio@redhat.com> | 2026-01-14 01:07:51 +0100 |
| commit | ab27852d0eebcd96d33c3699b44596a827b83bc6 (patch) | |
| tree | a093144849b08704e4443d499c6065e9cc77c0e1 | |
| parent | cce0470907d033ddfe6e80c1444dbb579c2b2c49 (diff) | |
| download | passt-ab27852d0eebcd96d33c3699b44596a827b83bc6.tar passt-ab27852d0eebcd96d33c3699b44596a827b83bc6.tar.gz passt-ab27852d0eebcd96d33c3699b44596a827b83bc6.tar.bz2 passt-ab27852d0eebcd96d33c3699b44596a827b83bc6.tar.lz passt-ab27852d0eebcd96d33c3699b44596a827b83bc6.tar.xz passt-ab27852d0eebcd96d33c3699b44596a827b83bc6.tar.zst passt-ab27852d0eebcd96d33c3699b44596a827b83bc6.zip | |
udp_flow: remove unneeded epoll_ref indirection
The fref union was used to convert flow_sidx_t to uint32_t for
assignment to ref.data. This is unnecessary since epoll_ref already
contains a flowside member of type flow_sidx_t, so we can assign
directly.
This aligns with how icmp.c and other callers assign flow_sidx_t to
epoll_ref.
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-- | udp_flow.c | 6 |
1 files changed, 1 insertions, 5 deletions
@@ -74,10 +74,6 @@ static int udp_flow_sock(const struct ctx *c, { const struct flowside *side = &uflow->f.side[sidei]; uint8_t pif = uflow->f.pif[sidei]; - union { - flow_sidx_t sidx; - uint32_t data; - } fref = { .sidx = FLOW_SIDX(uflow, sidei) }; union epoll_ref ref; int rc; int s; @@ -89,7 +85,7 @@ static int udp_flow_sock(const struct ctx *c, } ref.type = EPOLL_TYPE_UDP; - ref.data = fref.data; + ref.flowside = FLOW_SIDX(uflow, sidei); ref.fd = s; flow_epollid_set(&uflow->f, EPOLLFD_ID_DEFAULT); |
