On Tue, Apr 04, 2023 at 03:05:43PM +0200, Alexander Bluhm wrote:
> While comparing arp and ndp code I found some stylistic differences.
> Make both similar to catch such bugs easier.
kn@ asked me to commit the style fix upfront.
> if ndp -d does not find a neigbor entry, it removes the cloning
> route instead. Comparing the arp and ndp code shows that the latter
> has a fallthrough to delete. Return an error also in this case.
Here is the remaining bugfix.
ok?
bluhm
Index: usr.sbin/ndp/ndp.c
===================================================================
RCS file: /cvs/src/usr.sbin/ndp/ndp.c,v
retrieving revision 1.108
diff -u -p -r1.108 ndp.c
--- usr.sbin/ndp/ndp.c 4 Apr 2023 21:18:04 -0000 1.108
+++ usr.sbin/ndp/ndp.c 4 Apr 2023 21:21:18 -0000
@@ -436,12 +436,13 @@ 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) {