summaryrefslogtreecommitdiff
path: root/lib/filter_cli.c
diff options
context:
space:
mode:
authorIgor Ryzhov <iryzhov@nfware.com>2021-05-07 12:05:59 +0300
committerGitHub <noreply@github.com>2021-05-07 12:05:59 +0300
commitd0bb3c542cda6357b046063ee876d5e39363fb45 (patch)
tree27ecb096d7141bfa039ee492f865b6e266c2bbdb /lib/filter_cli.c
parent03d39784e7b4ec04e0c52b31d036de2fb684094e (diff)
parent6907bb6bbf8bff8575e6a9c6da78b353276feafd (diff)
Merge pull request #8632 from wesleycoakley/le-32-128-fix
lib: ip prefix-list "le" and "ge" bug squish
Diffstat (limited to 'lib/filter_cli.c')
-rw-r--r--lib/filter_cli.c42
1 files changed, 38 insertions, 4 deletions
diff --git a/lib/filter_cli.c b/lib/filter_cli.c
index e147ed5639..f030ce1b33 100644
--- a/lib/filter_cli.c
+++ b/lib/filter_cli.c
@@ -1360,14 +1360,31 @@ DEFPY_YANG(
nb_cli_enqueue_change(vty, "./ipv4-prefix", NB_OP_MODIFY,
prefix_str);
- if (ge_str)
+ if (ge_str) {
nb_cli_enqueue_change(
vty, "./ipv4-prefix-length-greater-or-equal",
NB_OP_MODIFY, ge_str);
- if (le_str)
+ } else {
+ /*
+ * Remove old ge if not being modified
+ */
+ nb_cli_enqueue_change(
+ vty, "./ipv4-prefix-length-greater-or-equal",
+ NB_OP_DESTROY, NULL);
+ }
+
+ if (le_str) {
nb_cli_enqueue_change(
vty, "./ipv4-prefix-length-lesser-or-equal",
NB_OP_MODIFY, le_str);
+ } else {
+ /*
+ * Remove old le if not being modified
+ */
+ nb_cli_enqueue_change(
+ vty, "./ipv4-prefix-length-lesser-or-equal",
+ NB_OP_DESTROY, NULL);
+ }
} else {
nb_cli_enqueue_change(vty, "./any", NB_OP_CREATE, NULL);
}
@@ -1561,14 +1578,31 @@ DEFPY_YANG(
nb_cli_enqueue_change(vty, "./ipv6-prefix", NB_OP_MODIFY,
prefix_str);
- if (ge_str)
+ if (ge_str) {
nb_cli_enqueue_change(
vty, "./ipv6-prefix-length-greater-or-equal",
NB_OP_MODIFY, ge_str);
- if (le_str)
+ } else {
+ /*
+ * Remove old ge if not being modified
+ */
+ nb_cli_enqueue_change(
+ vty, "./ipv6-prefix-length-greater-or-equal",
+ NB_OP_DESTROY, NULL);
+ }
+
+ if (le_str) {
nb_cli_enqueue_change(
vty, "./ipv6-prefix-length-lesser-or-equal",
NB_OP_MODIFY, le_str);
+ } else {
+ /*
+ * Remove old le if not being modified
+ */
+ nb_cli_enqueue_change(
+ vty, "./ipv6-prefix-length-lesser-or-equal",
+ NB_OP_DESTROY, NULL);
+ }
} else {
nb_cli_enqueue_change(vty, "./any", NB_OP_CREATE, NULL);
}