RFC; Should rpcb_getaddr() be changed to not use UDP?
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Mon, 24 Oct 2022 23:29:22 UTC
Hi, PR#267301 reports a problem with an NFSv3 mount, due to the fact that UDP is always used to contact rpcbind/portmapper for the address. The code in rpcb_getaddr() 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); } It is pretty obvious why it uses UDP. However, the question becomes "should that still be the case?". Unfortunately, changing this function in libc will affect everything that uses rpcbind/portmapper, so it could either be considered a bugfix or a POLA violation to change it. The reporter notes that Azure expects TCP to be used and it appears that Linux now uses TCP, as well. The code has been like this since it was imported into FreeBSD from NetBSD 21years ago. Comments w.r.t. whether or not this should be changed would be appreciated. rick