On Thu, 4 Jul 2024 14:58:25 +1000 David Gibson <david(a)gibson.dropbear.id.au> wrote:sock_l4() creates a socket of the given IP protocol number, and adds it to the epoll state. Currently it determines the correct tag for the epoll data based on the protocol. However, we have some future cases where we might want different semantics, and therefore epoll types, for sockets of the same protocol. So, change sock_l4() to take the epoll type as an explicit parameter, and determine the protocol from that.The interface is a bit surprising, but I guess it makes later changes much more convenient, so be it. Just one nit:Signed-off-by: David Gibson <david(a)gibson.dropbear.id.au> --- epoll_type.h | 41 +++++++++++++++++++++++++++++++++++++++++ icmp.c | 2 +- passt.h | 32 -------------------------------- tcp.c | 10 +++++----- udp.c | 12 ++++++------ util.c | 48 ++++++++++++++++++++++++++---------------------- util.h | 3 ++- 7 files changed, 81 insertions(+), 67 deletions(-) create mode 100644 epoll_type.h diff --git a/epoll_type.h b/epoll_type.h new file mode 100644 index 00000000..42e876e5 --- /dev/null +++ b/epoll_type.h @@ -0,0 +1,41 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later + * Copyright Red Hat + * Author: Davd Gibson <david(a)gibson.dropbear.id.au>I'm fairly sure it's spellt David. :) -- Stefano