summaryrefslogtreecommitdiff
path: root/usr.sbin/bgpd
diff options
context:
space:
mode:
Diffstat (limited to 'usr.sbin/bgpd')
-rw-r--r--usr.sbin/bgpd/rde_rib.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/usr.sbin/bgpd/rde_rib.c b/usr.sbin/bgpd/rde_rib.c
index f8c1cded341..6da515a03f7 100644
--- a/usr.sbin/bgpd/rde_rib.c
+++ b/usr.sbin/bgpd/rde_rib.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rde_rib.c,v 1.89 2006/12/12 10:26:47 claudio Exp $ */
+/* $OpenBSD: rde_rib.c,v 1.90 2006/12/12 10:30:33 claudio Exp $ */
/*
* Copyright (c) 2003, 2004 Claudio Jeker <claudio@openbsd.org>
@@ -391,6 +391,8 @@ prefix_compare(const struct bgpd_addr *a, const struct bgpd_addr *b,
return (aa - ba);
return (0);
case AF_INET6:
+ if (prefixlen > 128)
+ fatalx("prefix_cmp: bad IPv6 prefixlen");
for (i = 0; i < prefixlen / 8; i++)
if (a->v6.s6_addr[i] != b->v6.s6_addr[i])
return (a->v6.s6_addr[i] - b->v6.s6_addr[i]);