summaryrefslogtreecommitdiffstats
path: root/zebra
diff options
context:
space:
mode:
authorMark Stapp <mjs@voltanet.io>2021-03-01 16:48:05 +0100
committerMark Stapp <mjs@voltanet.io>2021-04-07 21:38:09 +0200
commitaef1d5404fabe113e66bbc49499a7eb2b96aaab4 (patch)
tree9616c8e85329f88318741a49157eb217bed7782b /zebra
parentMerge pull request #8405 from mjstapp/skip_backup_lsps (diff)
downloadfrr-aef1d5404fabe113e66bbc49499a7eb2b96aaab4.tar.xz
frr-aef1d5404fabe113e66bbc49499a7eb2b96aaab4.zip
zebra: add config control to hide backup nh events in nht
Add a config that can control hiding of backup-nexthop activation changes in nexthop-tracking. Signed-off-by: Mark Stapp <mjs@voltanet.io>
Diffstat (limited to 'zebra')
-rw-r--r--zebra/zebra_rnh.c18
-rw-r--r--zebra/zebra_rnh.h4
-rw-r--r--zebra/zebra_vty.c17
3 files changed, 38 insertions, 1 deletions
diff --git a/zebra/zebra_rnh.c b/zebra/zebra_rnh.c
index 3b0ef7198..0a9ef244b 100644
--- a/zebra/zebra_rnh.c
+++ b/zebra/zebra_rnh.c
@@ -52,6 +52,11 @@
DEFINE_MTYPE_STATIC(ZEBRA, RNH, "Nexthop tracking object");
+/* UI controls whether to notify about changes that only involve backup
+ * nexthops. Default is to notify all changes.
+ */
+static bool rnh_hide_backups;
+
static void free_state(vrf_id_t vrf_id, struct route_entry *re,
struct route_node *rn);
static void copy_state(struct rnh *rnh, const struct route_entry *re,
@@ -1321,3 +1326,16 @@ int rnh_resolve_via_default(struct zebra_vrf *zvrf, int family)
else
return 0;
}
+
+/*
+ * UI control to avoid notifications if backup nexthop status changes
+ */
+void rnh_set_hide_backups(bool hide_p)
+{
+ rnh_hide_backups = hide_p;
+}
+
+bool rnh_get_hide_backups(void)
+{
+ return rnh_hide_backups;
+}
diff --git a/zebra/zebra_rnh.h b/zebra/zebra_rnh.h
index c71a2b9cc..4897a6af3 100644
--- a/zebra/zebra_rnh.h
+++ b/zebra/zebra_rnh.h
@@ -64,6 +64,10 @@ extern void zebra_print_rnh_table(vrf_id_t vrfid, afi_t afi, struct vty *vty,
extern int rnh_resolve_via_default(struct zebra_vrf *zvrf, int family);
+/* UI control to avoid notifications if backup nexthop status changes */
+void rnh_set_hide_backups(bool hide_p);
+bool rnh_get_hide_backups(void);
+
#ifdef __cplusplus
}
#endif
diff --git a/zebra/zebra_vty.c b/zebra/zebra_vty.c
index 283a3e52d..8187d9922 100644
--- a/zebra/zebra_vty.c
+++ b/zebra/zebra_vty.c
@@ -1696,7 +1696,6 @@ DEFUN (no_ipv6_nht_default_route,
"Filter Next Hop tracking route resolution\n"
"Resolve via default route\n")
{
-
ZEBRA_DECLVAR_CONTEXT(vrf, zvrf);
if (!zvrf)
@@ -1710,6 +1709,17 @@ DEFUN (no_ipv6_nht_default_route,
return CMD_SUCCESS;
}
+DEFPY_HIDDEN(rnh_hide_backups, rnh_hide_backups_cmd,
+ "[no] ip nht hide-backup-events",
+ NO_STR
+ IP_STR
+ "Nexthop-tracking configuration\n"
+ "Hide notification about backup nexthops\n")
+{
+ rnh_set_hide_backups(!no);
+ return CMD_SUCCESS;
+}
+
DEFPY (show_route,
show_route_cmd,
"show\
@@ -3656,6 +3666,9 @@ static int config_write_protocol(struct vty *vty)
if (!zebra_nhg_recursive_use_backups())
vty_out(vty, "no zebra nexthop resolve-via-backup\n");
+ if (rnh_get_hide_backups())
+ vty_out(vty, "ip nht hide-backup-events\n");
+
#ifdef HAVE_NETLINK
/* Include netlink info */
netlink_config_write_helper(vty);
@@ -4115,6 +4128,8 @@ void zebra_vty_init(void)
install_element(VRF_NODE, &no_ip_nht_default_route_cmd);
install_element(VRF_NODE, &ipv6_nht_default_route_cmd);
install_element(VRF_NODE, &no_ipv6_nht_default_route_cmd);
+ install_element(CONFIG_NODE, &rnh_hide_backups_cmd);
+
install_element(VIEW_NODE, &show_ipv6_mroute_cmd);
/* Commands for VRF */