From 7bd86b3cfb0d929ce1dae2b937c3ac9048e23644 Mon Sep 17 00:00:00 2001 From: Benny Halevy Date: Mon, 18 May 2009 10:47:51 -0400 Subject: [PATCH] Extend -N command line option syntax to accept . to disable support for . Only 4.1 is currently supported. Signed-off-by: Benny Halevy Signed-off-by: Steve Dickson --- utils/nfsd/nfsd.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/utils/nfsd/nfsd.c b/utils/nfsd/nfsd.c index ac264da..bd23d9d 100644 --- a/utils/nfsd/nfsd.c +++ b/utils/nfsd/nfsd.c @@ -50,6 +50,7 @@ main(int argc, char **argv) int count = 1, c, error, port, fd, found_one; struct servent *ent; struct hostent *hp; + char *p; ent = getservbyname ("nfs", "udp"); if (ent != NULL) @@ -80,10 +81,14 @@ main(int argc, char **argv) } break; case 'N': - switch((c = atoi(optarg))) { - case 2: - case 3: + switch((c = strtol(optarg, &p, 0))) { case 4: + if (*p == '.') { + minorvers4 = -atoi(p + 1); + break; + } + case 3: + case 2: NFSCTL_VERUNSET(versbits, c); break; default: -- 2.39.5