[Bug 267301] nfs uses udp for portmapper even when proto=tcp specified
Date: Mon, 24 Oct 2022 23:12:46 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=267301
--- Comment #1 from Rick Macklem <rmacklem@FreeBSD.org> ---
Well, here's what the code in rpcb_getaddr(), found in
lib/libc/rpc/rpcb_clnt.c looks like:
/*
* Try UDP only - there are some portmappers out
* there that use UDP only.
*/
if (strcmp(nconf->nc_proto, NC_TCP) == 0) {
struct netconfig *newnconf;
if ((newnconf = getnetconfigent("udp")) == NULL) {
rpc_createerr.cf_stat = RPC_UNKNOWNPROTO;
return (NULL);
}
client = getclnthandle(host, newnconf, &parms.r_addr);
freenetconfigent(newnconf);
} else {
client = getclnthandle(host, nconf, &parms.r_addr);
}
Pretty obvious why it uses UDP.
Now, this code is only compiled into rpcb_clnt.c when PORTMAP is defined.
It is defined in lib/libc/rpc/Makefile.inc.
(I suspect taking -DPORTMAP out of this Makefile.inc would make it
use TCP, once you rebuild libc from the sources and link mount_nfs
to that.)
I may try this, but I do not have an easy way to do so, since my
systems are old laptops with very little storage (ok for building
a kernel, but not for "make buildworld", etc).
Then the problem is that this change affects everyone. I do not
see a way to only enable it based on a new mount option.
So what happens if this breaks a mount for someone else?
That would be a POLA violation, since the code has been like this
for decades, I suspect?
It would be best for you to patch this for youyr local systems,
although I will ask on the freebsd-fs@ mailing list, to see what
others think of making this change?
--
You are receiving this mail because:
You are the assignee for the bug.