summaryrefslogtreecommitdiff
path: root/lib/filter.h
diff options
context:
space:
mode:
authorIgor Ryzhov <iryzhov@nfware.com>2021-08-10 21:46:37 +0300
committerIgor Ryzhov <iryzhov@nfware.com>2021-08-10 22:31:42 +0300
commit667dcc277c15c0bddc785f9b949d658f8d815818 (patch)
tree5db5368f1e14b3b7d5d116f156872c45b0c13f31 /lib/filter.h
parentdd4c59d79a0f053ff1a2c2acc177e6a26e6c4137 (diff)
lib: fix prefix-list duplication check
Currently, when we check the new prefix-list entry for duplication, we only take filled in fields into account and ignore optional fields. For example, if we already have `ip prefix-list A 0.0.0.0/0 le 32` and we try to add `ip prefix-list A 0.0.0.0/0`, it is treated as duplicate. We should always compare all prefix-list fields when doing the check. Fixes #9355. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
Diffstat (limited to 'lib/filter.h')
-rw-r--r--lib/filter.h9
1 files changed, 4 insertions, 5 deletions
diff --git a/lib/filter.h b/lib/filter.h
index 941fabd38b..d1956ec019 100644
--- a/lib/filter.h
+++ b/lib/filter.h
@@ -207,11 +207,10 @@ struct plist_dup_args {
/** Entry action. */
const char *pda_action;
-#define PDA_MAX_VALUES 4
- /** Entry XPath for value. */
- const char *pda_xpath[PDA_MAX_VALUES];
- /** Entry value to match. */
- const char *pda_value[PDA_MAX_VALUES];
+ bool any;
+ struct prefix prefix;
+ int ge;
+ int le;
/** Duplicated entry found in list? */
bool pda_found;