summaryrefslogtreecommitdiffstats
path: root/support/include/conn.h
diff options
context:
space:
mode:
authorNeil Brown <neilb@suse.de>2007-03-13 14:39:49 +1100
committerNeil Brown <neilb@suse.de>2007-03-13 14:39:49 +1100
commit7f9343a38c031d9cc61a6bc7e06df519b16d1293 (patch)
treeb6aba3d7909bf6aaa0b1ac1f12e2c4acd0c32621 /support/include/conn.h
parent813ac37954352d3ca597cdcf895fc5aec22dec15 (diff)
downloadnfs-utils-7f9343a38c031d9cc61a6bc7e06df519b16d1293.tar.gz
nfs-utils-7f9343a38c031d9cc61a6bc7e06df519b16d1293.tar.xz
nfs-utils-7f9343a38c031d9cc61a6bc7e06df519b16d1293.zip
Restore use of un-connected socket for UDP mount requests.
When connecting to an NFSv4 server we need to find out IP address as it would be seen by the server, to register an address for callbacks. This is most easily done by connecting the socket to the servers address and then getting the address of our endpoint. However with a connected UDP socket, replies that come from a different IP address - as can happen with non-Linux multi-homed servers - will be rejected. So if we connected our UDP socket, we need to be sure to disconnect it before using it. This patch adds an option to get_socket to say if we want it connected or not and, in the case where we do, we disconnect a UDP socket after the connection information has been used. Also clean up the error handling in clnt_ping which was getting clumsy.
Diffstat (limited to 'support/include/conn.h')
-rw-r--r--support/include/conn.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/support/include/conn.h b/support/include/conn.h
index 1761dc4..11f16ab 100644
--- a/support/include/conn.h
+++ b/support/include/conn.h
@@ -35,7 +35,7 @@ int clnt_ping(struct sockaddr_in *, const u_long, const u_long, const u_int,
struct sockaddr_in *);
u_long nfsvers_to_mnt(const u_long);
u_long mntvers_to_nfs(const u_long);
-int get_socket(struct sockaddr_in *, u_int, int);
+int get_socket(struct sockaddr_in *, u_int, int, int);
CLIENT * mnt_openclnt(clnt_addr_t *, int *);
void mnt_closeclnt(CLIENT *, int);