diff options
author | Claudio Jeker <claudio@cvs.openbsd.org> | 2019-05-31 08:22:26 +0000 |
---|---|---|
committer | Claudio Jeker <claudio@cvs.openbsd.org> | 2019-05-31 08:22:26 +0000 |
commit | 3b11f52a62b3ddda7d3fae2d3c8c2283aa8b8120 (patch) | |
tree | 6b013ac1282391c6ed1584ff78a90df36648fac6 /usr.sbin | |
parent | 2b5a6c305ff4a948522f8caaaf0d21c91ea129aa (diff) |
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@
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/bgpd/parse.y | 5 |
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 " |