when ioctl() for getting the broadcast address fails, continue the loop to the next...
authorRonnie Sahlberg <ronniesahlberg@gmail.com>
Sun, 3 Jul 2011 22:46:19 +0000 (08:46 +1000)
committerRonnie Sahlberg <ronniesahlberg@gmail.com>
Sun, 3 Jul 2011 22:46:19 +0000 (08:46 +1000)
examples/nfsclient-bcast.c
lib/libnfs-sync.c

index 8140f5222862589f221d6a8ad525329cc4465c03..f461a29adb2de0dc9df9c553a4f5b6da024c8494 100644 (file)
@@ -157,12 +157,10 @@ int main(int argc _U_, char *argv[] _U_)
                        continue;
                }
                if (ioctl(rpc_get_fd(rpc), SIOCGIFBRDADDR, &ifc.ifc_req[i]) < 0) {
-                       printf("ioctl DRBADDR failed\n");
-                       exit(10);
+                       continue;
                }
                if (getnameinfo(&ifc.ifc_req[i].ifr_broadaddr, sizeof(struct sockaddr_in), &bcdd[0], sizeof(bcdd), NULL, 0, NI_NUMERICHOST) < 0) {
-                       printf("getnameinfo failed\n");
-                       exit(10);
+                       continue;
                }
                if (rpc_set_udp_destination(rpc, bcdd, 111, 1) < 0) {
                        printf("failed to set udp destination %s\n", rpc_get_error(rpc));
index 59493c5b17a3ddcaa49e29fb73f4a5854ed39079..4dd224c5cdaaf68f301105271a40f12cc1e163dc 100644 (file)
@@ -1259,14 +1259,10 @@ struct nfs_server_list *nfs_find_local_servers(void)
                        continue;
                }
                if (ioctl(rpc_get_fd(rpc), SIOCGIFBRDADDR, &ifc.ifc_req[i]) < 0) {
-                       rpc_destroy_context(rpc);
-                       free(ifc.ifc_buf);      
-                       return NULL;
+                       continue;
                }
                if (getnameinfo(&ifc.ifc_req[i].ifr_broadaddr, sizeof(struct sockaddr_in), &bcdd[0], sizeof(bcdd), NULL, 0, NI_NUMERICHOST) < 0) {
-                       rpc_destroy_context(rpc);
-                       free(ifc.ifc_buf);      
-                       return NULL;
+                       continue;
                }
                if (rpc_set_udp_destination(rpc, bcdd, 111, 1) < 0) {
                        rpc_destroy_context(rpc);