epoll: Tiny cleanup to udp_sock_handler()

Move the test for c->no_udp into the function itself, rather than in the
dispatching switch statement to better localize the UDP specific logic, and
make for greated consistency with other handler functions.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
This commit is contained in:
David Gibson
2023-08-11 15:12:25 +10:00
committed by Stefano Brivio
parent 05f606ab0b
commit 8271a2ed57
2 changed files with 2 additions and 3 deletions

2
udp.c
View File

@@ -756,7 +756,7 @@ void udp_sock_handler(struct ctx *c, union epoll_ref ref, uint32_t events,
struct mmsghdr *mmh_recv;
int i, m;
if (!(events & EPOLLIN))
if (c->no_udp || !(events & EPOLLIN))
return;
if (v6) {