about summary refs log tree commit diff
path: root/sunrpc
diff options
context:
space:
mode:
Diffstat (limited to 'sunrpc')
-rw-r--r--sunrpc/pmap_clnt.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/sunrpc/pmap_clnt.c b/sunrpc/pmap_clnt.c
index 05cfe2fa52..4db0f023b6 100644
--- a/sunrpc/pmap_clnt.c
+++ b/sunrpc/pmap_clnt.c
@@ -51,7 +51,7 @@
  * interface. portmap caches interfaces, and on DHCP clients,
  * it could be that only loopback is started at this time.
  */
-static void
+static bool_t
 __get_myaddress (struct sockaddr_in *addr)
 {
   int s;
@@ -89,7 +89,7 @@ __get_myaddress (struct sockaddr_in *addr)
           *addr = *((struct sockaddr_in *) &ifr->ifr_addr);
           addr->sin_port = htons (PMAPPORT);
           __close (s);
-          return;
+          return TRUE;
         }
       ifr++;
     }
@@ -99,6 +99,7 @@ __get_myaddress (struct sockaddr_in *addr)
       goto again;
     }
   __close (s);
+  return FALSE;
 }
 
 
@@ -118,7 +119,8 @@ pmap_set (u_long program, u_long version, int protocol, u_short port)
   struct pmap parms;
   bool_t rslt;
 
-  __get_myaddress (&myaddress);
+  if (!__get_myaddress (&myaddress))
+    return FALSE;
   client = clntudp_bufcreate (&myaddress, PMAPPROG, PMAPVERS,
 			timeout, &socket, RPCSMALLMSGSIZE, RPCSMALLMSGSIZE);
   if (client == (CLIENT *) NULL)
@@ -152,7 +154,8 @@ pmap_unset (u_long program, u_long version)
   struct pmap parms;
   bool_t rslt;
 
-  __get_myaddress (&myaddress);
+  if (!__get_myaddress (&myaddress))
+    return FALSE;
   client = clntudp_bufcreate (&myaddress, PMAPPROG, PMAPVERS,
 			timeout, &socket, RPCSMALLMSGSIZE, RPCSMALLMSGSIZE);
   if (client == (CLIENT *) NULL)