summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorkn <kn@cvs.openbsd.org>2019-08-23 15:42:00 +0000
committerkn <kn@cvs.openbsd.org>2019-08-23 15:42:00 +0000
commitb5ff0ea5b2beba8a5693e98af9f8e73379068d75 (patch)
tree17dcaf7c97e99f50ab29fe92476803fd037918d7 /usr.sbin
parentef2a14cc385312095f978052bfb0123e04304b44 (diff)
Honour -n when setting entries
Just like avoiding reverse lookups when printing entries or not resolving hostnames when deleting entries, make -n effect setting entries as well; just like pfctl(8)'s -N from which the manual wording was copied verbatim. OK deraadt
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/ndp/ndp.87
-rw-r--r--usr.sbin/ndp/ndp.c4
2 files changed, 7 insertions, 4 deletions
diff --git a/usr.sbin/ndp/ndp.8 b/usr.sbin/ndp/ndp.8
index d622e584ab5..62cdaa8a2b3 100644
--- a/usr.sbin/ndp/ndp.8
+++ b/usr.sbin/ndp/ndp.8
@@ -1,4 +1,4 @@
-.\" $OpenBSD: ndp.8,v 1.45 2017/08/09 14:36:00 florian Exp $
+.\" $OpenBSD: ndp.8,v 1.46 2019/08/23 15:41:59 kn Exp $
.\" $KAME: ndp.8,v 1.28 2002/07/17 08:46:33 itojun Exp $
.\"
.\" Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -28,7 +28,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.Dd $Mdocdate: August 9 2017 $
+.Dd $Mdocdate: August 23 2019 $
.Dt NDP 8
.Os
.Sh NAME
@@ -122,7 +122,8 @@ option for a description of the file format.
.It Fl i Ar interface
View ND information for the specified interface.
.It Fl n
-Do not try to resolve numeric addresses to hostnames.
+Do not perform domain name resolution.
+If a name cannot be resolved without DNS, an error will be reported.
.It Xo
.Fl s Ar nodename ether_addr
.Op Cm temp
diff --git a/usr.sbin/ndp/ndp.c b/usr.sbin/ndp/ndp.c
index 71391565ec1..38d795c3015 100644
--- a/usr.sbin/ndp/ndp.c
+++ b/usr.sbin/ndp/ndp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ndp.c,v 1.94 2019/08/22 19:33:57 kn Exp $ */
+/* $OpenBSD: ndp.c,v 1.95 2019/08/23 15:41:59 kn Exp $ */
/* $KAME: ndp.c,v 1.101 2002/07/17 08:46:33 itojun Exp $ */
/*
@@ -330,6 +330,8 @@ set(int argc, char **argv)
bzero(&hints, sizeof(hints));
hints.ai_family = AF_INET6;
+ if (nflag)
+ hints.ai_flags = AI_NUMERICHOST;
gai_error = getaddrinfo(host, NULL, &hints, &res);
if (gai_error) {
warnx("%s: %s", host, gai_strerror(gai_error));