From 0b312395aecdc3a7a2ce891c1167ebf01b697e45 Mon Sep 17 00:00:00 2001 From: Alexander Bluhm Date: Wed, 5 Apr 2023 13:56:42 +0000 Subject: If ndp -d did not find a neigbor entry, it removed the cloning route instead. Comparing the arp(8) and ndp(8) code shows that the latter has a fallthrough to delete. Return an error also in this case. OK kn@ --- usr.sbin/ndp/ndp.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/usr.sbin/ndp/ndp.c b/usr.sbin/ndp/ndp.c index d358a912ea0..198ac6381ec 100644 --- a/usr.sbin/ndp/ndp.c +++ b/usr.sbin/ndp/ndp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ndp.c,v 1.108 2023/04/04 21:18:04 bluhm Exp $ */ +/* $OpenBSD: ndp.c,v 1.109 2023/04/05 13:56:41 bluhm Exp $ */ /* $KAME: ndp.c,v 1.101 2002/07/17 08:46:33 itojun Exp $ */ /* @@ -436,13 +436,14 @@ delete(const char *host) if ((rtm->rtm_flags & RTF_GATEWAY) == 0) goto delete; } - /* - * IPv4 arp command retries with sin_other = SIN_PROXY here. - */ - warnx("delete: cannot locate %s", host); - return 1; } + /* + * IPv4 arp command retries with sin_other = SIN_PROXY here. + */ + warnx("delete: cannot locate %s", host); + return 1; + delete: if (sdl->sdl_family != AF_LINK) { printf("cannot locate %s\n", host); -- cgit v1.2.3