diff options
author | Jeff Layton <jlayton@redhat.com> | 2010-02-12 14:23:16 -0500 |
---|---|---|
committer | Steve Dickson <steved@redhat.com> | 2010-02-12 14:23:16 -0500 |
commit | 8f9493d13f884a62d7581326c1925a8171b3b0bd (patch) | |
tree | 3e60d02a969d3ae67d3fec277be9441cf806e32b /utils/mount/network.c | |
parent | 7b0e4faaf3169c69828d3f7769ed8ce9142e100b (diff) | |
download | nfs-utils-8f9493d13f884a62d7581326c1925a8171b3b0bd.tar.gz nfs-utils-8f9493d13f884a62d7581326c1925a8171b3b0bd.tar.xz nfs-utils-8f9493d13f884a62d7581326c1925a8171b3b0bd.zip |
This is the second iteration of this patch. The only difference here
is that this one has default_value call nfs_nfs_proto_family regardless
of whether IPV6_SUPPORTED is set.
When IPv6 is enabled, the Proto= config file option is treated as a
netid, and the address family for lookups is selected based on that
setting. The Defaultproto= option however still only affects the
protocol setting for the sockets (IPPROTO_*) and not the address family.
This patch makes it so that if someone sets the "Defaultproto=" option
in the nfsmount.conf, it's used to determine the default address family
for lookups as well as the protocol type.
This gives users a way to force a particular address family to be used
universally for mounts and brings the behavior of the Defaultproto=
option in line with the Proto= option.
Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve Dickson <steved@redhat.com>
Diffstat (limited to 'utils/mount/network.c')
-rw-r--r-- | utils/mount/network.c | 18 |
1 files changed, 8 insertions, 10 deletions
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) |