1 minor finding
Earlier concerns neither republished nor resolved: 1 suggestion. See the Run archive for their assessments.
Findings
[minor] · Chunked receive shim truncates datagrams and can block mapport shutdown
In manual runs with port mapping enabled, applying the chunk cap to datagrams makes ordinary PCP/NAT-PMP replies unusable and can leave netlink gateway discovery blocking shutdown.
Location: src/util/sock.cpp:83 (head).
Details and suggested fix
Sock::Recv now caps reads without checking the socket type. An individually queued PCP/NAT-PMP reply is below the 100-byte threshold, so the caller receives at most one byte. On POSIX, a consuming short datagram receive discards the remainder rather than leaving it for another read. The response validators reject that byte, retries repeat the failure, and truncating the unsupported-version reply also prevents NAT-PMP fallback. Linux/FreeBSD gateway discovery uses a blocking netlink datagram socket. If the cap prevents parsing the completion message and no gateway has already been returned, discovery can consume the queued replies and block on the next receive. Its loop has no timeout or interrupt check, so InterruptMapPort cannot release it and shutdown waits in StopMapPort's thread join. This hang depends on kernel FIONREAD support and response layout; no observed occurrence is established. Port mapping defaults to enabled, although -proxy and -listen=0 soft-disable it. The standard unit and functional test setup disables port mapping, and the PCP tests override Recv, so those tests bypass these paths. Apply the diagnostic cap only to SOCK_STREAM sockets, for example using SO_TYPE, and preserve the caller's length for other socket types. Datagram truncation is not TCP chunking and should not require changes to these callers.
Earlier concerns
Earlier reports raised these, with the titles and severities shown there. This review neither republished nor resolved them.
- [suggestion]: The standalone socket-test fix is bundled with the reproducer (earlier report)