diff -urN util-linux-2.12.o/mount/nfs_mount4.h util-linux-2.12.w/mount/nfs_mount4.h --- util-linux-2.12.o/mount/nfs_mount4.h 2000-10-14 10:20:51.000000000 -0400 +++ util-linux-2.12.w/mount/nfs_mount4.h 2004-01-19 10:01:31.000000000 -0500 @@ -8,7 +8,8 @@ * so it is easiest to ignore the kernel altogether (at compile time). */ -#define NFS_MOUNT_VERSION 4 +#define NFS_MOUNT_VERSION 6 +#define NFS_MAX_CONTEXT_LEN 512 struct nfs2_fh { char data[32]; @@ -36,6 +37,8 @@ int namlen; /* 2 */ unsigned int bsize; /* 3 */ struct nfs3_fh root; /* 4 */ + int pseudoflavor; /* 5 (2.6 kernel) */ + char context[NFS_MAX_CONTEXT_LEN + 1]; /* 6 */ }; /* bits in the flags field */ diff -urN util-linux-2.12.o/mount/nfsmount.c util-linux-2.12.w/mount/nfsmount.c --- util-linux-2.12.o/mount/nfsmount.c 2002-04-05 06:35:53.000000000 -0500 +++ util-linux-2.12.w/mount/nfsmount.c 2004-01-19 11:48:08.448456656 -0500 @@ -119,8 +119,11 @@ nfs_mount_version = 4; /* since 2.2.18pre9 */ else if (kernel_version < MAKE_VERSION(2,3,99)) nfs_mount_version = 3; + else if (kernel_version < MAKE_VERSION(2,6,1)) + /* XXX change this when kernel patch is upstream */ + nfs_mount_version = 4; /* since 2.3.99pre4 */ else - nfs_mount_version = 4; /* since 2.3.99pre4 */ + nfs_mount_version = 6; } if (nfs_mount_version > NFS_MOUNT_VERSION) nfs_mount_version = NFS_MOUNT_VERSION; @@ -389,6 +392,15 @@ printf(_("Warning: Option namlen is not supported.\n")); } else if (!strcmp(opt, "addr")) { /* ignore */; + } else if (!strcmp(opt, "context")) { + char *context = opteq + 1; + + if (strlen(context) > NFS_MAX_CONTEXT_LEN) { + printf(_("context parameter exceeds limit of %d\n"), + NFS_MAX_CONTEXT_LEN); + goto fail; + } + strncpy(data.context, context, NFS_MAX_CONTEXT_LEN); } else { printf(_("unknown nfs mount parameter: " "%s=%d\n"), opt, val);