From 1ad6f93185b6735f259d2e7ff13da0f6776e8f5c Mon Sep 17 00:00:00 2001 From: Ronnie Sahlberg Date: Mon, 4 Jul 2011 08:46:19 +1000 Subject: [PATCH] when ioctl() for getting the broadcast address fails, continue the loop to the next entry instead of exiting out --- examples/nfsclient-bcast.c | 6 ++---- lib/libnfs-sync.c | 8 ++------ 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/examples/nfsclient-bcast.c b/examples/nfsclient-bcast.c index 8140f52..f461a29 100644 --- a/examples/nfsclient-bcast.c +++ b/examples/nfsclient-bcast.c @@ -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)); diff --git a/lib/libnfs-sync.c b/lib/libnfs-sync.c index 59493c5..4dd224c 100644 --- a/lib/libnfs-sync.c +++ b/lib/libnfs-sync.c @@ -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); -- 2.34.1