NFS mounts default to a mix of udp and tcp

Rick Macklem rmacklem at uoguelph.ca
Wed Jun 3 15:51:52 UTC 2009


Although it doesn't explain the problem with nfs mounts over udp where the
mountd doesn't seem to reply, this might explain some of the confusion.

Near the beginning of mount_nfs.c, "nfsproto" is initialized to IPPROTO_UDP
and, as such, by default, the mount protocol and NFS Null RPC is done over
"udp". However, the -current kernel code in sys/nfsclient/nfs_vfsops.c and
the system call done by mount_nfs.c defaults to "tcp".

Therefore, unless "udp" or "tcp" is explicitly specified as mount_nfs options,
it uses "udp" for the mount protocol and Null RPC, then switches to "tcp" from
there on.

This wasn't something I changed, so I think it has been this way since the
nmount() syscall was introduced.

Seems like the default should be all "tcp" or all "udp". Which do you think
it should be?

rick
ps: This would explain a case where a server only supports udp and the mount
     didn't explicitly specify "udp", but it doesn't explain why mounts seem
     to be intermittently failing.


More information about the freebsd-current mailing list