diff options
| author | Laurent Vivier <lvivier@redhat.com> | 2026-06-19 12:30:06 +0200 |
|---|---|---|
| committer | Stefano Brivio <sbrivio@redhat.com> | 2026-07-20 23:27:10 +0200 |
| commit | 81a99ce3e73bde052f792d52d260eef5b2a821a8 (patch) | |
| tree | ba5ec6cf5db1573f5d825e9fd0e26078ccbc9fe6 | |
| parent | c80d9db312dfa98909bf3b3a5b2655785cdb3b07 (diff) | |
| download | passt-81a99ce3e73bde052f792d52d260eef5b2a821a8.tar passt-81a99ce3e73bde052f792d52d260eef5b2a821a8.tar.gz passt-81a99ce3e73bde052f792d52d260eef5b2a821a8.tar.bz2 passt-81a99ce3e73bde052f792d52d260eef5b2a821a8.tar.lz passt-81a99ce3e73bde052f792d52d260eef5b2a821a8.tar.xz passt-81a99ce3e73bde052f792d52d260eef5b2a821a8.tar.zst passt-81a99ce3e73bde052f792d52d260eef5b2a821a8.zip | |
udp, icmp: Remove unused timer_run fields from protocol contexts
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 <lvivier@redhat.com>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
| -rw-r--r-- | icmp.h | 7 | ||||
| -rw-r--r-- | passt.c | 2 | ||||
| -rw-r--r-- | passt.h | 2 | ||||
| -rw-r--r-- | udp.h | 2 |
4 files changed, 1 insertions, 12 deletions
@@ -20,12 +20,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 */ @@ -144,7 +144,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; } /** @@ -200,7 +200,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 @@ -286,7 +285,6 @@ struct ctx { int no_udp; struct udp_ctx udp; int no_icmp; - struct icmp_ctx icmp; int no_dns; int no_dns_search; @@ -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; }; |
