summaryrefslogtreecommitdiff
path: root/ripd/rip_cli.c
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2019-03-15 08:37:44 -0400
committerGitHub <noreply@github.com>2019-03-15 08:37:44 -0400
commit7bc2b18cb4a1bb027169269b13def3c2cf3d97fb (patch)
tree6372710b9d8d91bbc39abd997c3991a4e9c184e8 /ripd/rip_cli.c
parent6e65fa2b6d14f6fa160c0d97d53ba876f9dbf71f (diff)
parent58e39d522b1d55cdd58ce5833298bf23aa27ce05 (diff)
Merge pull request #3900 from opensourcerouting/ripd-fix-no-passive-iface
ripd: fix removal of configured passive interfaces
Diffstat (limited to 'ripd/rip_cli.c')
-rw-r--r--ripd/rip_cli.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/ripd/rip_cli.c b/ripd/rip_cli.c
index 6fbcdc059b..62aaad5d97 100644
--- a/ripd/rip_cli.c
+++ b/ripd/rip_cli.c
@@ -378,10 +378,19 @@ DEFPY (rip_passive_interface,
"Suppress routing updates on an interface\n"
"Interface name\n")
{
- nb_cli_enqueue_change(vty, "./passive-interface",
- no ? NB_OP_DESTROY : NB_OP_CREATE, ifname);
- nb_cli_enqueue_change(vty, "./non-passive-interface",
- no ? NB_OP_CREATE : NB_OP_DESTROY, ifname);
+ bool passive_default =
+ yang_dnode_get_bool(vty->candidate_config->dnode, "%s%s",
+ VTY_CURR_XPATH, "/passive-default");
+
+ if (passive_default) {
+ nb_cli_enqueue_change(vty, "./non-passive-interface",
+ no ? NB_OP_CREATE : NB_OP_DESTROY,
+ ifname);
+ } else {
+ nb_cli_enqueue_change(vty, "./passive-interface",
+ no ? NB_OP_DESTROY : NB_OP_CREATE,
+ ifname);
+ }
return nb_cli_apply_changes(vty, NULL);
}