@@ -77,16 +77,14 @@
#include <string.h>
#include <unistd.h>
+#include <rpcsvc/nfs_prot.h>
+
#include "fedfs.h"
#include "nsdb.h"
#include "junction.h"
#include "junction-internal.h"
#include "xlog.h"
-#ifndef NFS_PORT
-#define NFS_PORT (2049)
-#endif
-
/**
* Tag name of NFS location element of a junction XML document
*/
@@ -41,6 +41,8 @@
#include <netdb.h>
#include <errno.h>
+#include <rpcsvc/nfs_prot.h>
+
#include "nsdb.h"
#include "junction.h"
#include "nsdb-internal.h"
@@ -627,7 +629,7 @@ nsdb_nfsfsl_to_uri(const struct fedfs_nfs_fsl *nfsfsl, UriUriA *uri)
nsdb_assign_textrange(&uri->scheme, "nfs");
nsdb_assign_textrange(&uri->hostText, nfsfsl->fn_fslhost);
- if (nfsfsl->fn_fslport != 2049 && nfsfsl->fn_fslport != 0) {
+ if (nfsfsl->fn_fslport != NFS_PORT && nfsfsl->fn_fslport != 0) {
char portbuf[8];
sprintf(portbuf, "%u", nfsfsl->fn_fslport);
nsdb_assign_textrange(&uri->portText, portbuf);
@@ -28,6 +28,8 @@
#include <stdlib.h>
#include <stdio.h>
+#include <rpcsvc/nfs_prot.h>
+
#include "fedfs.h"
#include "junction.h"
#include "nsdb.h"
@@ -194,9 +196,12 @@ static void
nfsref_lookup_display_fedfs_nfs_fsl(struct fedfs_nfs_fsl *nfsl)
{
char *rootpath;
+ unsigned port = nfsl->fn_fslport;
printf("\tFileserver name:\t\t%s\n", nfsl->fn_fslhost);
- printf("\tFileserver port:\t\t%u\n", nfsl->fn_fslport);
+ if (port == 0)
+ port = NFS_PORT;
+ printf("\tFileserver port:\t\t%u\n", port);
if (nsdb_path_array_to_posix(nfsl->fn_nfspath, &rootpath) == FEDFS_OK) {
printf("\tExport path:\t\t\t%s\n", rootpath);
@@ -40,6 +40,7 @@
#include <netdb.h>
#include <langinfo.h>
+#include <rpcsvc/nfs_prot.h>
#include <uuid/uuid.h>
#include "fedfs.h"
@@ -135,7 +136,7 @@ main(int argc, char **argv)
nsdb_env(&nsdbname, &nsdbport, &binddn, &nce);
- serverport = 0;
+ serverport = NFS_PORT;
while ((arg = getopt_long(argc, argv, nsdb_create_fsl_opts,
nsdb_create_fsl_longopts, NULL)) != -1) {
switch (arg) {
@@ -40,6 +40,7 @@
#include <netdb.h>
#include <langinfo.h>
+#include <rpcsvc/nfs_prot.h>
#include <uuid/uuid.h>
#include "fedfs.h"
@@ -115,7 +116,7 @@ nsdb_resolve_fsn_display_nfs_fsl(struct fedfs_nfs_fsl *nfsl)
if (status != FEDFS_OK)
return;
- if (nfsl->fn_fslport == 0)
+ if (nfsl->fn_fslport == 0 || nfsl->fn_fslport == NFS_PORT)
printf(" NFS fls_server:\t\t%s\n", nfsl->fn_fslhost);
else
printf(" NFS fls_server:\t\t%s:%u\n", nfsl->fn_fslhost,
Clean up: Replace local definition of the NFS_PORT port macro with the correct public header definition. Introduced by commit 4f681570 "libjunction: Add support for nfs-basic junctions", Thu Dec 22 15:40:01 2011. Clean up: Avoid using "zero" for the fileserver port when creating new NFS FSL records. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> --- src/libjunction/nfs.c | 6 ++---- src/libnsdb/administrator.c | 4 +++- src/nfsref/lookup.c | 7 ++++++- src/nsdbc/nsdb-create-fsl.c | 3 ++- src/nsdbc/nsdb-resolve-fsn.c | 3 ++- 5 files changed, 15 insertions(+), 8 deletions(-)