Date: Mon, 24 Oct 2022 23:12:46 +0000 From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 267301] nfs uses udp for portmapper even when proto=tcp specified Message-ID: <bug-267301-227-ag6BhhGGGg@https.bugs.freebsd.org/bugzilla/> In-Reply-To: <bug-267301-227@https.bugs.freebsd.org/bugzilla/> References: <bug-267301-227@https.bugs.freebsd.org/bugzilla/>
next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D267301 --- 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) =3D=3D 0) { struct netconfig *newnconf; if ((newnconf =3D getnetconfigent("udp")) =3D=3D NU= LL) { rpc_createerr.cf_stat =3D RPC_UNKNOWNPROTO; return (NULL); } client =3D getclnthandle(host, newnconf, &parms.r_a= ddr); freenetconfigent(newnconf); } else { client =3D 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? --=20 You are receiving this mail because: You are the assignee for the bug.=
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-267301-227-ag6BhhGGGg>