X-Git-Url: https://git.decadent.org.uk/gitweb/?p=nfs-utils.git;a=blobdiff_plain;f=utils%2Fmount%2Fnetwork.c;h=c400dd8beec3ecec07f674be8bc9a864ea6af4bf;hp=06cab6a4884497f378fcb9577b5180cffcfeab7e;hb=8f9493d13f884a62d7581326c1925a8171b3b0bd;hpb=7b0e4faaf3169c69828d3f7769ed8ce9142e100b 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)