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=eSUu7gbs; 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 4706A5A0622 for ; Tue, 07 Oct 2025 18:40:42 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1759855241; 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=+F06pVyhfWSS2ZKo4XPr5UDbzytATNbQi0rKE226y6g=; b=eSUu7gbsK0Upnqkb3Hv9hvZ6g1uWc8D53H0ccGQM02Sux5bIj3vF121f+PKbNIb2kKUPxE BKclD70kft2FOYETRJ3byXYhGLF9qQ36VNwEj/kb9R+ZERXqb5DS6Z0Vw6ZsRzXS+iv1jN QHDdeQMmR6ZbNuTQIsoIc2UlEH7RxGo= Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-482-uPxnK7_8OhWPDIcRy6iJbg-1; Tue, 07 Oct 2025 12:40:39 -0400 X-MC-Unique: uPxnK7_8OhWPDIcRy6iJbg-1 X-Mimecast-MFC-AGG-ID: uPxnK7_8OhWPDIcRy6iJbg_1759855238 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (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-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 9DCFB1800286 for ; Tue, 7 Oct 2025 16:40:38 +0000 (UTC) Received: from lenovo-t14s.redhat.com (unknown [10.45.224.166]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 620D71800446; Tue, 7 Oct 2025 16:40:37 +0000 (UTC) From: Laurent Vivier To: passt-dev@passt.top Subject: [PATCH v2 5/6] icmp: Use epollfd from flow_common structure Date: Tue, 7 Oct 2025 18:40:25 +0200 Message-ID: <20251007164026.3882026-6-lvivier@redhat.com> In-Reply-To: <20251007164026.3882026-1-lvivier@redhat.com> References: <20251007164026.3882026-1-lvivier@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: CXA0VOmzWmx8oOfdYs2Ba2AUZsm8r952IxqN2ZEJ1sQ_1759855238 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit content-type: text/plain; charset="US-ASCII"; x-default=true Message-ID-Hash: RZMLP2YPW4SEENVH2HDAHW642SZFECRU X-Message-ID-Hash: RZMLP2YPW4SEENVH2HDAHW642SZFECRU 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: Store epollfd in the flow_common structure for ICMP ping flows and use it for epoll operations instead of passing c->epollfd directly. This makes ICMP consistent with the recent TCP changes and follows the pattern established in previous commit. Signed-off-by: Laurent Vivier --- icmp.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/icmp.c b/icmp.c index 56dfac6c958e..6d099efde95b 100644 --- a/icmp.c +++ b/icmp.c @@ -149,7 +149,7 @@ unexpected: static void icmp_ping_close(const struct ctx *c, const struct icmp_ping_flow *pingf) { - epoll_del(c->epollfd, pingf->sock); + epoll_del(pingf->f.epollfd, pingf->sock); close(pingf->sock); flow_hash_remove(c, FLOW_SIDX(pingf, INISIDE)); } @@ -206,11 +206,13 @@ static struct icmp_ping_flow *icmp_ping_new(const struct ctx *c, if (pingf->sock > FD_REF_MAX) goto cancel; + flow_set_epollfd(&pingf->f, c->epollfd); + ref.type = EPOLL_TYPE_PING; ref.flowside = FLOW_SIDX(flow, TGTSIDE); ref.fd = pingf->sock; - if (epoll_add(c->epollfd, EPOLLIN, &ref) < 0) { + if (epoll_add(pingf->f.epollfd, EPOLLIN, &ref) < 0) { close(pingf->sock); goto cancel; } -- 2.50.1