summaryrefslogtreecommitdiffstats
path: root/support/nfs/conn.c
Commit message (Collapse)AuthorAgeFilesLines
* libnfs.a: eliminate conn.c and conn.hChuck Lever2007-07-301-21/+0
| | | | | | | conn.[ch] are now no longer needed. Clean them out and delete them. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Neil Brown <neilb@suse.de>
* libnfs.a: move get_socket() function to utils/mount/network.cChuck Lever2007-07-301-78/+0
| | | | | | | | | | Now we can address the real problem: that get_socket() depends on the global variable "verbose" which is only available in the mount command. Move get_socket() into utils/mount/network.c, and make it static. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Neil Brown <neilb@suse.de>
* libnfs.a: move clnt_ping() to utils/mountChuck Lever2007-07-301-75/+0
| | | | | | | | | | Continue clean up of mount functionality in libnfs.a by moving clnt_ping() to utils/mount/network.c. Note that socklen_t is an unsigned int... the i386 gcc compiler threw a signedness warning about the 3rd argument of getsockname(). Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Neil Brown <neilb@suse.de>
* libnfs.a: move more mount-only functions out of libnfs.aChuck Lever2007-07-301-18/+0
| | | | | | | Continue clean-up with nfsvers_to_mnt() and mntvers_to_nfs(). Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Neil Brown <neilb@suse.de>
* libnfs.a: move mnt_{open, close}clnt calls to utils/mount/network.cChuck Lever2007-07-301-48/+0
| | | | | | | | | | | | | | | | | It turns out that get_socket() accesses a global variable, "verbose," that is only available in the mount command; yet it's in libnfs.a. This creates an undocumented API dependency that will bite someone someday. This mount-specific functionality doesn't really belong in libnfs.a anyway. The simplest way to resolve this is to move all of the functions in support/nfs/conn.c into utils/mount. network.c seems like the logical place to put these. An added benefit is we eventually get to make get_socket() static. Let's start with the mnt_{open,close}clnt functions. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Neil Brown <neilb@suse.de>
* mount.nfs: Fix retry= to handle lack of reserved port situationFlavio Leitner2007-07-101-0/+8
| | | | | | | | | | In the case of several (>500) mounts running at the same time with -o tcp, the number of attempts that succeed is about 300-500 because it run out of priviledged port (they are busy in TIME_WAIT state). Signed-off-by: Flavio Leitner <flavio.leitner@gmail.com> Signed-off-by: Neil Brown <neilb@suse.de>
* Restore use of un-connected socket for UDP mount requests.Neil Brown2007-03-131-27/+35
| | | | | | | | | | | | | | | | | | | | | | 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.
* Use socklen_t some more to avoid warnings.Greg Banks2006-07-031-1/+6
|
* Merge branch 'master' of git://linux-nfs.org/nfs-utilsGreg Banks2006-07-031-3/+10
|\
| * Try to make sure that clientid used for NFSv4 is reliable.Neil Brown2006-06-231-3/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | We need to give an IP address to identify this client to the server. The current code does a gethostbyname of the hostname. One some systems this returns 127.0.0.1 or similar, which is not useful. Instead, use getsockname of the sock used to connect to the server to confirm that the server is working. This gives the address on the interface that was chosen to talk to that server, which is the best address we can find (if there is a NAT in the way, it might still not work, but in that case there is nothing we can do).
* | Fix a number of the easier compile warnings: unused variables,Greg Banks2006-06-221-0/+1
|/ | | | unused labels, constness, signedness.
* Move NFS mount code from util-linux to nfs-utils - part 2Amit Gud2006-06-161-0/+211
Adds the support functions needed for mount and umount. This functionality will someday be available in the form of shared mount library. Signed-off-by: Amit Gud <agud@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>