Skip to content

portmap, cmd/gomodfs: make the static portmapper importable - #30

Merged
bradfitz merged 1 commit into
mainfrom
bradfitz/portmap_pkg
Oct 5, 2026
Merged

bradfitz merged 1 commit into
mainfrom
bradfitz/portmap_pkg

Conversation

@bradfitz

@bradfitz bradfitz commented Oct 5, 2026

Copy link
Copy Markdown
Member

The Windows NFS client always asks a portmapper on port 111 for the NFS
and MOUNT ports, so serving gomodfs to Windows clients needs one. The
static portmapper that does this lived in package main of cmd/gomodfs,
so corp's CI, which runs gomodfs's NFS server inside cihostlet and
needs to point Windows guests at it, would have had to copy it.

Move it to a new portmap package with a Server type that answers
GETPORT for the NFS, MOUNT, and NLM programs over TCP with a fixed
port, serving on a caller-provided net.Listener and net.PacketConn so
callers can choose addresses and filter clients. cmd/gomodfs's
-portmapper flag uses it, with unchanged behavior on the wire.

Along the way, TCP connections are now served concurrently instead of
one at a time, and per-packet logging is optional.

Updates tailscale/corp#24037

The Windows NFS client always asks a portmapper on port 111 for the NFS
and MOUNT ports, so serving gomodfs to Windows clients needs one. The
static portmapper that does this lived in package main of cmd/gomodfs,
so corp's CI, which runs gomodfs's NFS server inside cihostlet and
needs to point Windows guests at it, would have had to copy it.

Move it to a new portmap package with a Server type that answers
GETPORT for the NFS, MOUNT, and NLM programs over TCP with a fixed
port, serving on a caller-provided net.Listener and net.PacketConn so
callers can choose addresses and filter clients. cmd/gomodfs's
-portmapper flag uses it, with unchanged behavior on the wire.

Along the way, TCP connections are now served concurrently instead of
one at a time, and per-packet logging is optional.

Updates tailscale/corp#24037

Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
@bradfitz
bradfitz merged commit 6fe3ef0 into main Oct 5, 2026
4 of 7 checks passed
@bradfitz
bradfitz deleted the bradfitz/portmap_pkg branch October 5, 2026 20:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant