From ae5f6c8e1b95580ca3c2f245e02efb28ad11e2aa Mon Sep 17 00:00:00 2001 From: David Gibson Date: Fri, 11 Aug 2023 15:12:29 +1000 Subject: epoll: Use different epoll types for passt and pasta tap fds Currently we have a single epoll event type for the "tap" fd, which could be either a handle on a /dev/net/tun device (pasta) or a connected Unix socket (passt). However for the two modes we call different handler functions. Simplify this a little by using different epoll types and dispatching directly to the correct handler function. Signed-off-by: David Gibson Signed-off-by: Stefano Brivio --- tap.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'tap.h') diff --git a/tap.h b/tap.h index dd6bfdd..021fb7c 100644 --- a/tap.h +++ b/tap.h @@ -77,7 +77,10 @@ void tap_send_frames(struct ctx *c, const struct iovec *iov, size_t n); void tap_update_mac(struct tap_hdr *taph, const unsigned char *eth_d, const unsigned char *eth_s); void tap_listen_handler(struct ctx *c, uint32_t events); -void tap_handler(struct ctx *c, uint32_t events, const struct timespec *now); +void tap_handler_pasta(struct ctx *c, uint32_t events, + const struct timespec *now); +void tap_handler_passt(struct ctx *c, uint32_t events, + const struct timespec *now); void tap_sock_init(struct ctx *c); #endif /* TAP_H */ -- cgit v1.2.3