]> granicus.if.org Git - libtirpc/commitdiff
rpcb_getaddr: Handle only "udp" and "tcp" netids when using PMAP_GETPORT
authorChuck Lever <chuck.lever@oracle.com>
Mon, 30 Nov 2009 13:55:43 +0000 (08:55 -0500)
committerSteve Dickson <steved@redhat.com>
Mon, 30 Nov 2009 13:55:43 +0000 (08:55 -0500)
The PORTMAP logic in __rpcb_findaddr_timed() already prevents its
use if the protocol family is not PF_INET.  In addition, ensure that
the rpcbind v2 logic in __rpcb_findaddr_timed() is executed only if
the requested transport protocol name is "tcp" or "udp".

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Steve Dickson <steved@redhat.com>
src/rpcb_clnt.c

index e8a5d27212c0667c761574dc392067c18d83149e..4a3e96c0332d5e4e28b12c661763fc5d9f3bf9e9 100644 (file)
@@ -759,9 +759,10 @@ __rpcb_findaddr_timed(program, version, nconf, host, clpp, tp)
                        }
                        client = getclnthandle(host, newnconf, &parms.r_addr);
                        freenetconfigent(newnconf);
-               } else {
+               } else if (strcmp(nconf->nc_proto, NC_UDP) == 0)
                        client = getclnthandle(host, nconf, &parms.r_addr);
-               }
+               else
+                       goto try_rpcbind;
                if (client == NULL)
                        return (NULL);