aboutgitcodebugslistschat
diff options
context:
space:
mode:
authorDavid Gibson <david@gibson.dropbear.id.au>2025-01-30 17:52:10 +1100
committerStefano Brivio <sbrivio@redhat.com>2025-02-03 07:32:37 +0100
commit10c4a9e1b383becd7366bda986f886675f7c4cb2 (patch)
tree2295d9904b217f7336fea0e1de011359c04bee7b
parentdd6a6854c73a09c4091c1776ee7f349d1e1f966c (diff)
downloadpasst-10c4a9e1b383becd7366bda986f886675f7c4cb2.tar
passt-10c4a9e1b383becd7366bda986f886675f7c4cb2.tar.gz
passt-10c4a9e1b383becd7366bda986f886675f7c4cb2.tar.bz2
passt-10c4a9e1b383becd7366bda986f886675f7c4cb2.tar.lz
passt-10c4a9e1b383becd7366bda986f886675f7c4cb2.tar.xz
passt-10c4a9e1b383becd7366bda986f886675f7c4cb2.tar.zst
passt-10c4a9e1b383becd7366bda986f886675f7c4cb2.zip
tcp: Always pass NULL event with EPOLL_CTL_DEL
In tcp_epoll_ctl() we pass an event pointer with EPOLL_CTL_DEL, even though it will be ignored. It's possible this was a workaround for pre-2.6.9 kernels which required a non-NULL pointer here, but we rely on the kernel accepting NULL events for EPOLL_CTL_DEL in lots of other places. Use NULL instead for simplicity and consistency. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
-rw-r--r--tcp.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/tcp.c b/tcp.c
index c89f323..4eed82b 100644
--- a/tcp.c
+++ b/tcp.c
@@ -468,9 +468,9 @@ static int tcp_epoll_ctl(const struct ctx *c, struct tcp_tap_conn *conn)
if (conn->events == CLOSED) {
if (conn->in_epoll)
- epoll_ctl(c->epollfd, EPOLL_CTL_DEL, conn->sock, &ev);
+ epoll_ctl(c->epollfd, EPOLL_CTL_DEL, conn->sock, NULL);
if (conn->timer != -1)
- epoll_ctl(c->epollfd, EPOLL_CTL_DEL, conn->timer, &ev);
+ epoll_ctl(c->epollfd, EPOLL_CTL_DEL, conn->timer, NULL);
return 0;
}