forked from pool/util-linux
35 lines
981 B
Diff
35 lines
981 B
Diff
--- util-linux-2.12q/mount/nfsmount.c
|
|
+++ util-linux-2.12q/mount/nfsmount.c
|
|
@@ -169,8 +169,20 @@
|
|
}
|
|
if (!p.pm_vers)
|
|
p.pm_vers = MOUNTVERS;
|
|
- if (!p.pm_prot)
|
|
+ if (!p.pm_prot) {
|
|
p.pm_prot = IPPROTO_TCP;
|
|
+ if (!p.pm_port) {
|
|
+ p.pm_port = pmap_getport(server_addr,
|
|
+ p.pm_prog, p.pm_vers, p.pm_prot);
|
|
+ }
|
|
+ /* Fall back to UDP if there's no TCP registration for mount */
|
|
+ if (!p.pm_port) {
|
|
+ fprintf(stderr, "mount server reported tcp not available, falling back to udp\n");
|
|
+ p.pm_prot = IPPROTO_UDP;
|
|
+ p.pm_port = pmap_getport(server_addr,
|
|
+ p.pm_prog, p.pm_vers, p.pm_prot);
|
|
+ }
|
|
+ }
|
|
#if 0
|
|
if (!p.pm_port) {
|
|
p.pm_port = pmap_getport(server_addr, p.pm_prog, p.pm_vers,
|
|
@@ -584,7 +596,8 @@
|
|
pm_mnt = get_mountport(&mount_server_addr,
|
|
mountprog,
|
|
mountvers,
|
|
- proto,
|
|
+ 0, /* TCP or UDP: pick
|
|
+ whatever is available */
|
|
mountport,
|
|
nfs_mount_version);
|
|
|