- if (r != RPC_SUCCESS) {
- clnt_perror(ysd->dom_client, "yp_order: clnt_call");
- ysd->dom_vers = -1;
+
+ if (r != RPC_SUCCESS)
+ {
+ /* call failed - switch protocols and try again */
+ if (tries++) clnt_perror(ysd->dom_client, "yp_order: clnt_call");
+
+ if (proto == YP_BIND_UDP) proto = YP_BIND_TCP;
+ else proto = YP_BIND_UDP;
+ ysd->dom_vers = proto;
+