};
unsigned int protobits = NFSCTL_ALLBITS;
unsigned int versbits = NFSCTL_ALLBITS;
+int minorvers4; /* nfsv4 minor version */
char *haddr = NULL;
int
int count = 1, c, error, port, fd, found_one;
struct servent *ent;
struct hostent *hp;
+ char *p;
ent = getservbyname ("nfs", "udp");
if (ent != NULL)
}
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:
- fprintf(stderr, "%c: Unsupported version\n", c);
+ fprintf(stderr, "%s: Unsupported version\n", optarg);
exit(1);
}
break;
fprintf(stderr, "no version specified\n");
exit(1);
}
- if (NFSCTL_VERISSET(versbits, 4) && !NFSCTL_TCPISSET(versbits)) {
+
+ if (NFSCTL_VERISSET(versbits, 4) && !NFSCTL_TCPISSET(protobits)) {
fprintf(stderr, "version 4 requires the TCP protocol\n");
exit(1);
}
closeall(3);
openlog("nfsd", LOG_PID, LOG_DAEMON);
- if ((error = nfssvc(port, count, versbits, protobits, haddr)) < 0) {
+ if ((error = nfssvc(port, count, versbits, minorvers4, protobits, haddr)) < 0) {
int e = errno;
syslog(LOG_ERR, "nfssvc: %s", strerror(e));
closelog();