From a4d3ebe82267f50b38a5c06d0d2f70d11de730dc Mon Sep 17 00:00:00 2001 From: Delweng Date: Tue, 3 Mar 2026 23:21:13 +0800 Subject: [PATCH] loose pong check Signed-off-by: Delweng --- cmd/devp2p/internal/v5test/discv5tests.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/cmd/devp2p/internal/v5test/discv5tests.go b/cmd/devp2p/internal/v5test/discv5tests.go index efe9144069..f8cbbf34c5 100644 --- a/cmd/devp2p/internal/v5test/discv5tests.go +++ b/cmd/devp2p/internal/v5test/discv5tests.go @@ -137,10 +137,13 @@ the attempt from a different IP.`) t.Fatal("expected WHOAREYOU, got", resp) } - // Catch the PONG on l2. + // Catch the PONG on l2. Only check the request ID here because cross-network + // routing may rewrite the source IP, making PONG.ToIP differ from laddr(l2).IP. switch resp := conn.read(l2).(type) { case *v5wire.Pong: - checkPong(t, resp, ping2, l2) + if !bytes.Equal(resp.ReqID, ping2.ReqID) { + t.Fatalf("wrong request ID %x in PONG, want %x", resp.ReqID, ping2.ReqID) + } default: t.Fatal("expected PONG, got", resp) }