From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: passt.top; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: passt.top; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=U4WWq6M6; dkim-atps=neutral Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by passt.top (Postfix) with ESMTPS id CD9855A0275 for ; Fri, 03 Oct 2025 17:27:34 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1759505253; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=udmKbRJITXUw7DX5zn04CHTWQn009+muEOM/dr3hM4M=; b=U4WWq6M61YjwkZAhQ+hNQF7SyS6RkS7DDgP/9cHDVu+Xo/rt9cfcveBhylQVagESVJ8IUD YWy8vRV9aXY+jpEbjVJZ7YO6ATNMDj5T2B5FNydVvS9M9ps7Zk5C7LDujphgjDLJeKtQIh 37qi/plx8Y5Sb7sZ0uyUgWPK24c99rU= Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-632-dLbstGU3PDmWYaQj4im1Dg-1; Fri, 03 Oct 2025 11:27:31 -0400 X-MC-Unique: dLbstGU3PDmWYaQj4im1Dg-1 X-Mimecast-MFC-AGG-ID: dLbstGU3PDmWYaQj4im1Dg_1759505250 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 3B90B1956059 for ; Fri, 3 Oct 2025 15:27:30 +0000 (UTC) Received: from lenovo-t14s.redhat.com (unknown [10.45.224.166]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 227E219560BC; Fri, 3 Oct 2025 15:27:27 +0000 (UTC) From: Laurent Vivier To: passt-dev@passt.top Subject: [PATCH 5/5] udp: Use epollfd from flow_common structure Date: Fri, 3 Oct 2025 17:27:17 +0200 Message-ID: <20251003152717.2437765-6-lvivier@redhat.com> In-Reply-To: <20251003152717.2437765-1-lvivier@redhat.com> References: <20251003152717.2437765-1-lvivier@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: 5UZc05RRRxHD9TYQUB8HkIev5uRjcjzoMdsppP7Ynv4_1759505250 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit content-type: text/plain; charset="US-ASCII"; x-default=true Message-ID-Hash: 4JJCUAGUGOHD2FNIHHJZY4WROZNFI7YC X-Message-ID-Hash: 4JJCUAGUGOHD2FNIHHJZY4WROZNFI7YC X-MailFrom: lvivier@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Laurent Vivier X-Mailman-Version: 3.3.8 Precedence: list List-Id: Development discussion and patches for passt Archived-At: Archived-At: List-Archive: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Update UDP flow handling to use the epollfd field from the flow_common structure instead of accessing it from the context. This aligns UDP with the recent changes to TCP and ICMP flow management. Signed-off-by: Laurent Vivier --- udp_flow.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/udp_flow.c b/udp_flow.c index f99994523a6c..9843b9f5fb2f 100644 --- a/udp_flow.c +++ b/udp_flow.c @@ -51,7 +51,7 @@ void udp_flow_close(const struct ctx *c, struct udp_flow *uflow) flow_foreach_sidei(sidei) { flow_hash_remove(c, FLOW_SIDX(uflow, sidei)); if (uflow->s[sidei] >= 0) { - epoll_del(c->epollfd, uflow->s[sidei]); + epoll_del(uflow->f.epollfd, uflow->s[sidei]); close(uflow->s[sidei]); uflow->s[sidei] = -1; } @@ -91,9 +91,11 @@ static int udp_flow_sock(const struct ctx *c, ref.data = fref.data; ref.fd = s; + uflow->f.epollfd = c->epollfd; + ev.events = EPOLLIN; ev.data.u64 = ref.u64; - if (epoll_ctl(c->epollfd, EPOLL_CTL_ADD, s, &ev) == -1) { + if (epoll_ctl(uflow->f.epollfd, EPOLL_CTL_ADD, s, &ev) == -1) { int rc = -errno; close(s); warn("L4 epoll_ctl: %s", strerror_(-rc)); @@ -103,7 +105,7 @@ static int udp_flow_sock(const struct ctx *c, if (flowside_connect(c, s, pif, side) < 0) { int rc = -errno; - epoll_del(c->epollfd, s); + epoll_del(uflow->f.epollfd, s); close(s); flow_dbg_perror(uflow, "Couldn't connect flow socket"); -- 2.50.1