From f21204494064e28e9f0bb20f71a6071bead0d0e8 Mon Sep 17 00:00:00 2001 From: Stefano Brivio Date: Wed, 26 Oct 2022 17:55:53 +0200 Subject: icmp: Don't discard first reply sequence for a given echo ID In pasta mode, ICMP and ICMPv6 echo sockets relay back to us any reply we send: we're on the same host as the target, after all. We discard them by comparing the last sequence we sent with the sequence we receive. However, on the first reply for a given identifier, the sequence might be zero, depending on the implementation of ping(8): we need another value to indicate we haven't sent any sequence number, yet. Use -1 as initialiser in the echo identifier map. This is visible with Busybox's ping, and was reported by Paul on the integration at https://github.com/containers/podman/pull/16141, with: $ podman run --net=pasta alpine ping -c 2 192.168.188.1 ...where only the second reply would be routed back. Reported-by: Paul Holzinger Fixes: 33482d5bf293 ("passt: Add PASTA mode, major rework") Signed-off-by: Stefano Brivio Reviewed-by: David Gibson --- icmp.h | 1 + 1 file changed, 1 insertion(+) (limited to 'icmp.h') diff --git a/icmp.h b/icmp.h index 458ce31..275486d 100644 --- a/icmp.h +++ b/icmp.h @@ -15,6 +15,7 @@ void icmp_sock_handler(const struct ctx *c, union epoll_ref ref, int icmp_tap_handler(const struct ctx *c, int af, const void *addr, const struct pool *p, const struct timespec *now); void icmp_timer(const struct ctx *c, const struct timespec *ts); +void icmp_init(void); /** * union icmp_epoll_ref - epoll reference portion for ICMP tracking -- cgit v1.2.3