diff options
| author | Russ White <russ@riw.us> | 2022-01-18 09:08:38 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-01-18 09:08:38 -0500 |
| commit | 05786ac7744a6077a7f5aff9d2bfe1c92e54e17c (patch) | |
| tree | 7b25f5cda483135e144e490d3e8ac970b5781d7f /ospf6d/ospf6_top.c | |
| parent | c748ab25673c118e7ae67a82348af5f54c2bec64 (diff) | |
| parent | 485e8b5662dbecdb9f2e1a3e0a88dbfaffd640b2 (diff) | |
Merge pull request #9644 from opensourcerouting/ospf-opaque-attrs
OSPF opaque route attributes
Diffstat (limited to 'ospf6d/ospf6_top.c')
| -rw-r--r-- | ospf6d/ospf6_top.c | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/ospf6d/ospf6_top.c b/ospf6d/ospf6_top.c index 54f6c85cea..e2db77d44b 100644 --- a/ospf6d/ospf6_top.c +++ b/ospf6d/ospf6_top.c @@ -436,6 +436,7 @@ static struct ospf6 *ospf6_create(const char *name) o->fd = -1; o->max_multipath = MULTIPATH_NUM; + SET_FLAG(o->config_flags, OSPF6_SEND_EXTRA_DATA_TO_ZEBRA); o->oi_write_q = list_new(); @@ -885,6 +886,39 @@ DEFUN (no_ospf6_log_adjacency_changes_detail, return CMD_SUCCESS; } +static void ospf6_reinstall_routes(struct ospf6 *ospf6) +{ + struct ospf6_route *route; + + for (route = ospf6_route_head(ospf6->route_table); route; + route = ospf6_route_next(route)) + ospf6_zebra_route_update_add(route, ospf6); +} + +DEFPY (ospf6_send_extra_data, + ospf6_send_extra_data_cmd, + "[no] ospf6 send-extra-data zebra", + NO_STR + OSPF6_STR + "Extra data to Zebra for display/use\n" + "To zebra\n") +{ + VTY_DECLVAR_CONTEXT(ospf6, ospf6); + + if (no + && CHECK_FLAG(ospf6->config_flags, + OSPF6_SEND_EXTRA_DATA_TO_ZEBRA)) { + UNSET_FLAG(ospf6->config_flags, OSPF6_SEND_EXTRA_DATA_TO_ZEBRA); + ospf6_reinstall_routes(ospf6); + } else if (!CHECK_FLAG(ospf6->config_flags, + OSPF6_SEND_EXTRA_DATA_TO_ZEBRA)) { + SET_FLAG(ospf6->config_flags, OSPF6_SEND_EXTRA_DATA_TO_ZEBRA); + ospf6_reinstall_routes(ospf6); + } + + return CMD_SUCCESS; +} + DEFUN (ospf6_timers_lsa, ospf6_timers_lsa_cmd, "timers lsa min-arrival (0-600000)", @@ -2202,6 +2236,10 @@ static int config_write_ospf6(struct vty *vty) vty_out(vty, " ospf6 router-id %pI4\n", &ospf6->router_id_static); + if (!CHECK_FLAG(ospf6->config_flags, + OSPF6_SEND_EXTRA_DATA_TO_ZEBRA)) + vty_out(vty, " no ospf6 send-extra-data zebra\n"); + /* log-adjacency-changes flag print. */ if (CHECK_FLAG(ospf6->config_flags, OSPF6_LOG_ADJACENCY_CHANGES)) { @@ -2287,6 +2325,7 @@ void ospf6_top_init(void) install_element(OSPF6_NODE, &ospf6_log_adjacency_changes_detail_cmd); install_element(OSPF6_NODE, &no_ospf6_log_adjacency_changes_cmd); install_element(OSPF6_NODE, &no_ospf6_log_adjacency_changes_detail_cmd); + install_element(OSPF6_NODE, &ospf6_send_extra_data_cmd); /* LSA timers commands */ install_element(OSPF6_NODE, &ospf6_timers_lsa_cmd); |
