X-Git-Url: https://git.decadent.org.uk/gitweb/?p=nfs-utils.git;a=blobdiff_plain;f=utils%2Fmount%2Fnetwork.c;h=c400dd8beec3ecec07f674be8bc9a864ea6af4bf;hp=92bba2d72667e6f6043ccea2b089dae9fb460ef9;hb=8f9493d13f884a62d7581326c1925a8171b3b0bd;hpb=f0d3a4bedccca7cce48296757bc1c8bd59b80828 diff --git a/utils/mount/network.c b/utils/mount/network.c index 92bba2d..c400dd8 100644 --- a/utils/mount/network.c +++ b/utils/mount/network.c @@ -37,6 +37,7 @@ #include #include #include +#include #include #include #include @@ -1331,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. @@ -1341,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 */ @@ -1488,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)