--- usr.sbin/mountd/mountd.c 2014-08-21 22:03:28.470974123 -0700 +++ mountd.c 2014-10-17 11:09:25.018304295 -0700 @@ -240,6 +240,7 @@ int dolog = 0; int got_sighup = 0; int xcreated = 0; +int ip_only = 0; char *svcport_str = NULL; static int mallocd_svcport = 0; @@ -312,7 +313,7 @@ else close(s); - while ((c = getopt(argc, argv, "2deh:lnop:rS")) != -1) + while ((c = getopt(argc, argv, "2deh:ilnop:rS")) != -1) switch (c) { case '2': force_v2 = 1; @@ -329,6 +330,9 @@ case 'd': debug = debug ? 0 : 1; break; + case 'i': + ip_only = 1; + break; case 'l': dolog = 1; break; @@ -924,7 +928,7 @@ usage(void) { fprintf(stderr, - "usage: mountd [-2] [-d] [-e] [-l] [-n] [-p ] [-r] " + "usage: mountd [-2] [-d] [-e] [-i] [-l] [-n] [-p ] [-r] " "[-S] [-h ] [export_file ...]\n"); exit(1); } @@ -963,8 +967,9 @@ syslog(LOG_ERR, "request from unknown address family"); return; } - lookup_failed = getnameinfo(saddr, saddr->sa_len, host, sizeof host, - NULL, 0, 0); + if (!ip_only) + lookup_failed = getnameinfo(saddr, saddr->sa_len, host, + sizeof host, NULL, 0, 0); getnameinfo(saddr, saddr->sa_len, numerichost, sizeof numerichost, NULL, 0, NI_NUMERICHOST); switch (rqstp->rq_proc) {