If ndp -d did not find a neigbor entry, it removed the cloning route
authorbluhm <bluhm@openbsd.org>
Wed, 5 Apr 2023 13:56:41 +0000 (13:56 +0000)
committerbluhm <bluhm@openbsd.org>
Wed, 5 Apr 2023 13:56:41 +0000 (13:56 +0000)
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

index d358a91..198ac63 100644 (file)
@@ -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);