summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2009-11-11 17:23:16 +0000
committerderaadt <deraadt@openbsd.org>2009-11-11 17:23:16 +0000
commitb8ccb7b59f7691c22d2cc6ba71839417fff050f0 (patch)
tree4c8f9b160f0eb7b00bb69370441b94c362f7fb8b
parentdo not walk off the prefix array, off by one; found by parfait (diff)
downloadwireguard-openbsd-b8ccb7b59f7691c22d2cc6ba71839417fff050f0.tar.xz
wireguard-openbsd-b8ccb7b59f7691c22d2cc6ba71839417fff050f0.zip
correctly order the range check and use the right limits, pointed out by parfait
ok claudio millert
-rw-r--r--usr.sbin/rtsold/probe.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.sbin/rtsold/probe.c b/usr.sbin/rtsold/probe.c
index 172c6fe7d5c..ab16836bb46 100644
--- a/usr.sbin/rtsold/probe.c
+++ b/usr.sbin/rtsold/probe.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: probe.c,v 1.12 2008/03/24 16:11:05 deraadt Exp $ */
+/* $OpenBSD: probe.c,v 1.13 2009/11/11 17:23:16 deraadt Exp $ */
/* $KAME: probe.c,v 1.16 2002/06/10 20:00:36 itojun Exp $ */
/*
@@ -116,7 +116,7 @@ defrouter_probe(struct ifinfo *ifinfo)
goto closeandend;
}
- for (i = 0; dr.defrouter[i].if_index && i < PRLSTSIZ; i++) {
+ for (i = 0; i < DRLSTSIZ && dr.defrouter[i].if_index; i++) {
if (ifindex && dr.defrouter[i].if_index == ifindex) {
/* sanity check */
if (!IN6_IS_ADDR_LINKLOCAL(&dr.defrouter[i].rtaddr)) {