Based on #31022, this introduces a fuzz target for PCPRequestPortMap
and NATPMPRequestPortMap
.
Like in #31022 we set CreateSock
to return a Sock
which mocks the responses from the server and uses a mocked steady clock for the Wait
s. Except here we simply respond with fuzzer-provided data until the client stop sending requests. We also sometimes inject errors and connection failures based on fuzzer-provided data.
We reuse the existing FuzzedSock
, so a preparatory commit is included that adds steady clock mocking to it. This may be useful for other harnesses as well.