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=D6RcWI/z; dkim-atps=neutral Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by passt.top (Postfix) with ESMTPS id 657135A0262 for ; Fri, 19 Jun 2026 12:30:12 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1781865011; 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; bh=v+MNv70jIwtda712cgtKg861lw4ql0bmxjlS644K1u0=; b=D6RcWI/zyZUeEmdRjkRecgk8J+OeT/ADtSCzUJUb5s9I1Q0KjWyI1fERWfEclatdNcFhzi 7feWDV2TNsA6dOUUlpI9pKH2TbYNVkxwICXFQyCluh4/mA44z0uAxJ09Z6K5gRbO3vyOZE y1zbpx2KpgUSeCm3lFfR9d8E0dyjpaA= 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-649-7TLcQEoTMyOqZZRv2IVN9A-1; Fri, 19 Jun 2026 06:30:09 -0400 X-MC-Unique: 7TLcQEoTMyOqZZRv2IVN9A-1 X-Mimecast-MFC-AGG-ID: 7TLcQEoTMyOqZZRv2IVN9A_1781865008 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (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 BCC5B1955DB5 for ; Fri, 19 Jun 2026 10:30:08 +0000 (UTC) Received: from lenovo-t14s.redhat.corp (headnet05.pony-001.prod.iad2.dc.redhat.com [10.2.32.117]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 00D84180034F; Fri, 19 Jun 2026 10:30:07 +0000 (UTC) From: Laurent Vivier To: passt-dev@passt.top Subject: [PATCH] udp, icmp: Remove unused timer_run fields from protocol contexts Date: Fri, 19 Jun 2026 12:30:06 +0200 Message-ID: <20260619103006.1669522-1-lvivier@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: NOst2ac4Y0mrEyD46MWSOmU06n3iawUOF2r_f6pu8xg_1781865008 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit content-type: text/plain; charset="US-ASCII"; x-default=true Message-ID-Hash: Z7B3L4QTWBHH4NVS25WARI2NURZFNVKI X-Message-ID-Hash: Z7B3L4QTWBHH4NVS25WARI2NURZFNVKI 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: Since 260075bde769 ("tcp, udp, fwd: Run all port scanning from a single timer"), CALL_PROTO_HANDLER() is only used for TCP. UDP and ICMP timers now run from flow_defer_handler(), making the timer_run fields in struct udp_ctx and struct icmp_ctx dead stores. Remove the unused fields, drop struct icmp_ctx entirely (it has no remaining members), and stop initialising them in timer_init(). Signed-off-by: Laurent Vivier --- icmp.h | 7 ------- passt.c | 2 +- passt.h | 2 -- udp.h | 2 -- 4 files changed, 1 insertion(+), 12 deletions(-) diff --git a/icmp.h b/icmp.h index e8b928b61370..556260461995 100644 --- a/icmp.h +++ b/icmp.h @@ -19,12 +19,5 @@ int icmp_tap_handler(const struct ctx *c, uint8_t pif, sa_family_t af, struct iov_tail *data, const struct timespec *now); void icmp_init(void); -/** - * struct icmp_ctx - Execution context for ICMP routines - * @timer_run: Timestamp of most recent timer run - */ -struct icmp_ctx { - struct timespec timer_run; -}; #endif /* ICMP_H */ diff --git a/passt.c b/passt.c index b1d35d5bf988..677c8471a105 100644 --- a/passt.c +++ b/passt.c @@ -141,7 +141,7 @@ static void random_init(struct ctx *c) */ static void timer_init(struct ctx *c, const struct timespec *now) { - c->tcp.timer_run = c->udp.timer_run = c->icmp.timer_run = *now; + c->tcp.timer_run = *now; } /** diff --git a/passt.h b/passt.h index 3a072945c382..205d7eecede7 100644 --- a/passt.h +++ b/passt.h @@ -194,7 +194,6 @@ struct ip6_ctx { * @no_udp: Disable UDP operation * @udp: Context for UDP protocol handler * @no_icmp: Disable ICMP operation - * @icmp: Context for ICMP protocol handler * @mtu: MTU passed via DHCP/NDP * @no_dns: Do not source/use DNS servers for any purpose * @no_dns_search: Do not source/use domain search lists for any purpose @@ -279,7 +278,6 @@ struct ctx { int no_udp; struct udp_ctx udp; int no_icmp; - struct icmp_ctx icmp; int no_dns; int no_dns_search; diff --git a/udp.h b/udp.h index 9ea7de682caf..b50283eab198 100644 --- a/udp.h +++ b/udp.h @@ -26,14 +26,12 @@ void udp_update_l2_buf(const unsigned char *eth_d); * struct udp_ctx - Execution context for UDP * @scan_in: Port scanning state for inbound packets * @scan_out: Port scanning state for outbound packets - * @timer_run: Timestamp of most recent timer run * @timeout: Timeout for unidirectional flows (in s) * @stream_timeout: Timeout for stream-like flows (in s) */ struct udp_ctx { struct fwd_scan scan_in; struct fwd_scan scan_out; - struct timespec timer_run; int timeout; int stream_timeout; }; -- 2.54.0