summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--utils/mount/configfile.c6
-rw-r--r--utils/mount/network.c18
2 files changed, 14 insertions, 10 deletions
diff --git a/utils/mount/configfile.c b/utils/mount/configfile.c
index 1dd4159..5cff009 100644
--- a/utils/mount/configfile.c
+++ b/utils/mount/configfile.c
@@ -222,6 +222,8 @@ int inline check_vers(char *mopt, char *field)
unsigned long config_default_vers;
unsigned long config_default_proto;
+extern sa_family_t config_default_family;
+
/*
* Check to see if a default value is being set.
* If so, set the appropriate global value which will
@@ -243,6 +245,10 @@ int inline default_value(char *mopt)
xlog_warn("Unable to set default protocol : %s",
strerror(errno));
}
+ if (!nfs_nfs_proto_family(options, &config_default_family)) {
+ xlog_warn("Unable to set default family : %s",
+ strerror(errno));
+ }
} else {
xlog_warn("Unable to alloc memory for default protocol");
}
diff --git a/utils/mount/network.c b/utils/mount/network.c
index 06cab6a..c400dd8 100644
--- a/utils/mount/network.c
+++ b/utils/mount/network.c
@@ -1332,6 +1332,12 @@ nfs_nfs_port(struct mount_options *options, unsigned long *port)
return 1;
}
+#ifdef IPV6_SUPPORTED
+sa_family_t config_default_family = AF_UNSPEC;
+#else
+sa_family_t config_default_family = AF_INET;
+#endif
+
/*
* Returns TRUE and fills in @family if a valid NFS protocol option
* is found, or FALSE if the option was specified with an invalid value.
@@ -1342,11 +1348,7 @@ int nfs_nfs_proto_family(struct mount_options *options,
unsigned long protocol;
char *option;
-#ifdef IPV6_SUPPORTED
- *family = AF_UNSPEC;
-#else
- *family = AF_INET;
-#endif
+ *family = config_default_family;
switch (po_rightmost(options, nfs_transport_opttbl)) {
case 0: /* udp */
@@ -1489,11 +1491,7 @@ int nfs_mount_proto_family(struct mount_options *options,
unsigned long protocol;
char *option;
-#ifdef HAVE_LIBTIRPC
- *family = AF_UNSPEC;
-#else
- *family = AF_INET;
-#endif
+ *family = config_default_family;
option = po_get(options, "mountproto");
if (option != NULL)