summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2018-09-21 05:13:36 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2018-09-21 05:13:36 +0000
commitaec87534ac4b647d66070cf584ebe8b0d49a5be0 (patch)
tree775281c43b203237563ab4a9b6a4076a932346ee
parent1b158298f4e74198cd2bb96142943eff47ee90db (diff)
Move setting of the PREFIXSET_FLAG_OPS higher up since prefixset_item rule
is now also used by roa-set. Also set the prefix operation for roa-set items to OP_NONE since that what it actually needs to be.
-rw-r--r--usr.sbin/bgpd/parse.y11
1 files changed, 7 insertions, 4 deletions
diff --git a/usr.sbin/bgpd/parse.y b/usr.sbin/bgpd/parse.y
index 931fa057468..66847b8a451 100644
--- a/usr.sbin/bgpd/parse.y
+++ b/usr.sbin/bgpd/parse.y
@@ -1,4 +1,4 @@
-/* $OpenBSD: parse.y,v 1.356 2018/09/21 04:55:27 claudio Exp $ */
+/* $OpenBSD: parse.y,v 1.357 2018/09/21 05:13:35 claudio Exp $ */
/*
* Copyright (c) 2002, 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -447,6 +447,8 @@ prefixset : PREFIXSET STRING '{' optnl {
prefixset_l : prefixset_item {
struct prefixset_item *psi;
+ if ($1->p.op != OP_NONE)
+ curpset->sflags |= PREFIXSET_FLAG_OPS;
psi = RB_INSERT(prefixset_tree, &curpset->psitems, $1);
if (psi != NULL) {
if (cmd_opts & BGPD_OPT_VERBOSE2)
@@ -459,6 +461,8 @@ prefixset_l : prefixset_item {
}
| prefixset_l comma prefixset_item {
struct prefixset_item *psi;
+ if ($3->p.op != OP_NONE)
+ curpset->sflags |= PREFIXSET_FLAG_OPS;
psi = RB_INSERT(prefixset_tree, &curpset->psitems, $3);
if (psi != NULL) {
if (cmd_opts & BGPD_OPT_VERBOSE2)
@@ -481,8 +485,6 @@ prefixset_item : prefix prefixlenop {
fatal(NULL);
memcpy(&$$->p.addr, &$1.prefix, sizeof($$->p.addr));
$$->p.len = $1.len;
- if ($2.op != OP_NONE)
- curpset->sflags |= PREFIXSET_FLAG_OPS;
if (merge_prefixspec(&$$->p, &$2) == -1) {
free($$);
YYERROR;
@@ -4310,7 +4312,8 @@ add_roa_set(struct prefixset_item *npsi, u_int32_t as, u_int8_t max)
struct prefixset_item *psi;
struct roa_set rs;
- /* no prefixlen option on this tree */
+ /* no prefixlen option in this tree */
+ npsi->p.op = OP_NONE;
npsi->p.len_max = npsi->p.len_min = npsi->p.len;
psi = RB_INSERT(prefixset_tree, &curroaset->psitems, npsi);
if (psi == NULL)