summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorclaudio <claudio@openbsd.org>2019-05-31 08:22:25 +0000
committerclaudio <claudio@openbsd.org>2019-05-31 08:22:25 +0000
commit4eb6c0d1f2d7ff4d4500178f5b9d62d7768eef89 (patch)
treef923e42291b9bce996e656dc8c712cf38ee25da0
parentAdd MSI-X support for acpipci(4). This splits out some generic code into (diff)
downloadwireguard-openbsd-4eb6c0d1f2d7ff4d4500178f5b9d62d7768eef89.tar.xz
wireguard-openbsd-4eb6c0d1f2d7ff4d4500178f5b9d62d7768eef89.zip
Also check the type of a network statement when looking for duplicates.
Fixes adding network 0.0.0.0/0 after network inet static. OK phessler@ benno@
-rw-r--r--usr.sbin/bgpd/parse.y5
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.sbin/bgpd/parse.y b/usr.sbin/bgpd/parse.y
index c7321d139c4..10bd7085739 100644
--- a/usr.sbin/bgpd/parse.y
+++ b/usr.sbin/bgpd/parse.y
@@ -1,4 +1,4 @@
-/* $OpenBSD: parse.y,v 1.388 2019/05/27 09:14:32 claudio Exp $ */
+/* $OpenBSD: parse.y,v 1.389 2019/05/31 08:22:25 claudio Exp $ */
/*
* Copyright (c) 2002, 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -868,7 +868,8 @@ network : NETWORK prefix filter_set {
filterset_move($3, &n->net.attrset);
free($3);
TAILQ_FOREACH(m, netconf, entry) {
- if (n->net.prefixlen == m->net.prefixlen &&
+ if (n->net.type == m->net.type &&
+ n->net.prefixlen == m->net.prefixlen &&
prefix_compare(&n->net.prefix,
&m->net.prefix, n->net.prefixlen) == 0)
yyerror("duplicate prefix "