+ /*
+ * Do some sanity checking, if the ctlbits are set
+ */
+ if (!NFSCTL_UDPISSET(protobits) && !NFSCTL_TCPISSET(protobits)) {
+ fprintf(stderr, "invalid protocol specified\n");
+ exit(1);
+ }
+ found_one = 0;
+ for (c = NFSD_MINVERS; c <= NFSD_MAXVERS; c++) {
+ if (NFSCTL_VERISSET(versbits, c))
+ found_one = 1;
+ }
+ if (!found_one) {
+ fprintf(stderr, "no version specified\n");
+ exit(1);
+ }
+ if (NFSCTL_VERISSET(versbits, 4) && !NFSCTL_TCPISSET(versbits)) {
+ fprintf(stderr, "version 4 requires the TCP protocol\n");
+ exit(1);
+ }
+ if (haddr == NULL) {
+ struct in_addr in = {INADDR_ANY};
+ haddr = strdup(inet_ntoa(in));
+ }