Files
tailscale/net
Brad Fitzpatrick c277dd1791 net/memnet: add UDP support
Add Network.ListenPacket, making Network a nettype.PacketListener with
in-memory UDP sockets. Packets go by exact destination address and
port. Sending never blocks; packets to an address without a socket, or
to a full receive queue, are dropped. An unspecified or empty listen IP
binds the family's loopback address, and port zero picks the next
ephemeral port in rotation, so a just-closed socket's port isn't handed
right back out, as with an OS.

Reads block only on channels and timers, including for read deadlines,
so the sockets work in testing/synctest bubbles. That's for running
magicsock (via its TestOnlyPacketListener) and STUN (via
stuntest.ServeWithPacketListener) on an in-memory network with fake
time.

Updates #22831

Change-Id: Id7043412ca036b075927c6352c663d73f2b8657f
Signed-off-by: Brad Fitzpatrick <[email protected]>
2026-12-02 18:06:59 -08:00
..
2026-07-10 17:39:16 -07:00
2026-12-02 18:06:59 -08:00