(pmap_getport): Open TCP socket is protocol = IPPROTO_TCP.
authordrepper <drepper>
Tue, 14 Jan 2003 19:46:27 +0000 (19:46 +0000)
committerdrepper <drepper>
Tue, 14 Jan 2003 19:46:27 +0000 (19:46 +0000)
sunrpc/pm_getport.c

index a15f978..00e1ba9 100644 (file)
@@ -66,9 +66,13 @@ pmap_getport (address, program, version, protocol)
   struct pmap parms;
 
   address->sin_port = htons (PMAPPORT);
-  client = INTUSE(clntudp_bufcreate) (address, PMAPPROG, PMAPVERS, timeout,
-                                     &socket, RPCSMALLMSGSIZE,
-                                     RPCSMALLMSGSIZE);
+  if (protocol == IPPROTO_TCP)
+    client = INTUSE(clnttcp_create) (address, PMAPPROG, PMAPVERS, &socket,
+                                    RPCSMALLMSGSIZE, RPCSMALLMSGSIZE);
+  else
+    client = INTUSE(clntudp_bufcreate) (address, PMAPPROG, PMAPVERS, timeout,
+                                       &socket, RPCSMALLMSGSIZE,
+                                       RPCSMALLMSGSIZE);
   if (client != (CLIENT *) NULL)
     {
       struct rpc_createerr *ce = &get_rpc_createerr ();