diff options
| -rw-r--r-- | bgpd/bgp_route.c | 13 | ||||
| -rw-r--r-- | bgpd/bgp_vty.c | 21 | ||||
| -rw-r--r-- | doc/user/ospfd.rst | 45 | ||||
| -rw-r--r-- | ospfd/ospf_dump.c | 437 | ||||
| -rw-r--r-- | tests/topotests/bgp_gr_restart_retain_routes/r2/zebra.conf | 1 |
5 files changed, 224 insertions, 293 deletions
diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c index 7d4110029e..3324eb73de 100644 --- a/bgpd/bgp_route.c +++ b/bgpd/bgp_route.c @@ -3854,8 +3854,6 @@ int bgp_update(struct peer *peer, const struct prefix *p, uint32_t addpath_id, int do_loop_check = 1; int has_valid_label = 0; afi_t nh_afi; - uint8_t pi_type = 0; - uint8_t pi_sub_type = 0; bool force_evpn_import = false; safi_t orig_safi = safi; bool leak_success = true; @@ -4059,15 +4057,10 @@ int bgp_update(struct peer *peer, const struct prefix *p, uint32_t addpath_id, bgp_attr_add_gshut_community(&new_attr); } - if (pi) { - pi_type = pi->type; - pi_sub_type = pi->sub_type; - } - /* next hop check. */ - if (!CHECK_FLAG(peer->flags, PEER_FLAG_IS_RFAPI_HD) - && bgp_update_martian_nexthop(bgp, afi, safi, pi_type, pi_sub_type, - &new_attr, dest)) { + if (!CHECK_FLAG(peer->flags, PEER_FLAG_IS_RFAPI_HD) && + bgp_update_martian_nexthop(bgp, afi, safi, type, sub_type, + &new_attr, dest)) { peer->stat_pfx_nh_invalid++; reason = "martian or self next-hop;"; bgp_attr_flush(&new_attr); diff --git a/bgpd/bgp_vty.c b/bgpd/bgp_vty.c index 5b4a56233d..3c6a05c73f 100644 --- a/bgpd/bgp_vty.c +++ b/bgpd/bgp_vty.c @@ -9631,11 +9631,7 @@ DEFPY (show_bgp_srv6, struct listnode *node; struct srv6_locator_chunk *chunk; struct bgp_srv6_function *func; - struct in6_addr *tovpn4_sid; - struct in6_addr *tovpn6_sid; char buf[256]; - char buf_tovpn4_sid[256]; - char buf_tovpn6_sid[256]; bgp = bgp_get_default(); if (!bgp) @@ -9658,19 +9654,10 @@ DEFPY (show_bgp_srv6, vty_out(vty, "- name: %s\n", bgp->name ? bgp->name : "default"); - tovpn4_sid = bgp->vpn_policy[AFI_IP].tovpn_sid; - tovpn6_sid = bgp->vpn_policy[AFI_IP6].tovpn_sid; - if (tovpn4_sid) - inet_ntop(AF_INET6, tovpn4_sid, buf_tovpn4_sid, - sizeof(buf_tovpn4_sid)); - if (tovpn6_sid) - inet_ntop(AF_INET6, tovpn6_sid, buf_tovpn6_sid, - sizeof(buf_tovpn6_sid)); - - vty_out(vty, " vpn_policy[AFI_IP].tovpn_sid: %s\n", - tovpn4_sid ? buf_tovpn4_sid : "none"); - vty_out(vty, " vpn_policy[AFI_IP6].tovpn_sid: %s\n", - tovpn6_sid ? buf_tovpn6_sid : "none"); + vty_out(vty, " vpn_policy[AFI_IP].tovpn_sid: %pI6\n", + bgp->vpn_policy[AFI_IP].tovpn_sid); + vty_out(vty, " vpn_policy[AFI_IP6].tovpn_sid: %pI6\n", + bgp->vpn_policy[AFI_IP6].tovpn_sid); } return CMD_SUCCESS; diff --git a/doc/user/ospfd.rst b/doc/user/ospfd.rst index 26810bd883..3bb018548e 100644 --- a/doc/user/ospfd.rst +++ b/doc/user/ospfd.rst @@ -1060,78 +1060,83 @@ TI-LFA requires a proper Segment Routing configuration. Debugging OSPF ============== -.. clicmd:: debug ospf bfd +.. clicmd:: debug ospf [(1-65535)] bfd Enable or disable debugging for BFD events. This will show BFD integration library messages and OSPF BFD integration messages that are mostly state transitions and validation problems. -.. clicmd:: debug ospf client-api +.. clicmd:: debug ospf [(1-65535)] client-api Show debug information for the OSPF opaque data client API. -.. clicmd:: debug ospf packet (hello|dd|ls-request|ls-update|ls-ack|all) (send|recv) [detail] +.. clicmd:: debug ospf [(1-65535)] default-information + Show debug information of default information - Dump Packet for debugging +.. clicmd:: debug ospf [(1-65535)] packet (hello|dd|ls-request|ls-update|ls-ack|all) (send|recv) [detail] -.. clicmd:: debug ospf ism -.. clicmd:: debug ospf ism (status|events|timers) + Dump Packet for debugging +.. clicmd:: debug ospf [(1-65535)] ism [status|events|timers] - Show debug information of Interface State Machine -.. clicmd:: debug ospf nsm + Show debug information of Interface State Machine -.. clicmd:: debug ospf nsm (status|events|timers) +.. clicmd:: debug ospf [(1-65535)] nsm [status|events|timers] Show debug information of Network State Machine -.. clicmd:: debug ospf event +.. clicmd:: debug ospf [(1-65535)] event Show debug information of OSPF event -.. clicmd:: debug ospf nssa +.. clicmd:: debug ospf [(1-65535)] nssa Show debug information about Not So Stub Area -.. clicmd:: debug ospf lsa +.. clicmd:: debug ospf [(1-65535)] ldp-sync + + Show debug information about LDP-Sync -.. clicmd:: debug ospf lsa (generate|flooding|refresh) +.. clicmd:: debug ospf [(1-65535)] lsa [aggregate|flooding|generate|install|refresh] Show debug detail of Link State messages -.. clicmd:: debug ospf te +.. clicmd:: debug ospf [(1-65535)] sr + + Show debug information about Segment Routing + +.. clicmd:: debug ospf [(1-65535)] te Show debug information about Traffic Engineering LSA -.. clicmd:: debug ospf zebra +.. clicmd:: debug ospf [(1-65535)] ti-lfa -.. clicmd:: debug ospf zebra (interface|redistribute) + Show debug information about SR TI-LFA + +.. clicmd:: debug ospf [(1-65535)] zebra [interface|redistribute] Show debug information of ZEBRA API -.. clicmd:: debug ospf graceful-restart helper +.. clicmd:: debug ospf [(1-65535)] graceful-restart Enable/disable debug information for OSPF Graceful Restart Helper .. clicmd:: show debugging ospf -.. clicmd:: debug ospf lsa aggregate - - Debug commnd to enable/disable external route summarisation specific debugs. Sample Configuration diff --git a/ospfd/ospf_dump.c b/ospfd/ospf_dump.c index 258a93fb16..9b347891ec 100644 --- a/ospfd/ospf_dump.c +++ b/ospfd/ospf_dump.c @@ -54,13 +54,13 @@ unsigned long conf_debug_ospf_nsm = 0; unsigned long conf_debug_ospf_lsa = 0; unsigned long conf_debug_ospf_zebra = 0; unsigned long conf_debug_ospf_nssa = 0; -unsigned long conf_debug_ospf_te = 0; +unsigned long conf_debug_ospf_te; unsigned long conf_debug_ospf_ext = 0; -unsigned long conf_debug_ospf_sr = 0; -unsigned long conf_debug_ospf_ti_lfa = 0; -unsigned long conf_debug_ospf_defaultinfo = 0; -unsigned long conf_debug_ospf_ldp_sync = 0; -unsigned long conf_debug_ospf_gr = 0; +unsigned long conf_debug_ospf_sr; +unsigned long conf_debug_ospf_ti_lfa; +unsigned long conf_debug_ospf_defaultinfo; +unsigned long conf_debug_ospf_ldp_sync; +unsigned long conf_debug_ospf_gr; unsigned long conf_debug_ospf_bfd; unsigned long conf_debug_ospf_client_api; @@ -72,13 +72,13 @@ unsigned long term_debug_ospf_nsm = 0; unsigned long term_debug_ospf_lsa = 0; unsigned long term_debug_ospf_zebra = 0; unsigned long term_debug_ospf_nssa = 0; -unsigned long term_debug_ospf_te = 0; +unsigned long term_debug_ospf_te; unsigned long term_debug_ospf_ext = 0; -unsigned long term_debug_ospf_sr = 0; -unsigned long term_debug_ospf_ti_lfa = 0; +unsigned long term_debug_ospf_sr; +unsigned long term_debug_ospf_ti_lfa; unsigned long term_debug_ospf_defaultinfo; unsigned long term_debug_ospf_ldp_sync; -unsigned long term_debug_ospf_gr = 0; +unsigned long term_debug_ospf_gr; unsigned long term_debug_ospf_bfd; unsigned long term_debug_ospf_client_api; @@ -628,84 +628,9 @@ void ospf_packet_dump(struct stream *s) stream_set_getp(s, gp); } -DEFUN (debug_ospf_packet, +DEFPY (debug_ospf_packet, debug_ospf_packet_cmd, - "debug ospf [(1-65535)] packet <hello|dd|ls-request|ls-update|ls-ack|all> [<send [detail]|recv [detail]|detail>]", - DEBUG_STR - OSPF_STR - "Instance ID\n" - "OSPF packets\n" - "OSPF Hello\n" - "OSPF Database Description\n" - "OSPF Link State Request\n" - "OSPF Link State Update\n" - "OSPF Link State Acknowledgment\n" - "OSPF all packets\n" - "Packet sent\n" - "Detail Information\n" - "Packet received\n" - "Detail Information\n" - "Detail Information\n") -{ - int inst = (argv[2]->type == RANGE_TKN) ? 1 : 0; - int detail = strmatch(argv[argc - 1]->text, "detail"); - int send = strmatch(argv[argc - (1 + detail)]->text, "send"); - int recv = strmatch(argv[argc - (1 + detail)]->text, "recv"); - char *packet = argv[3 + inst]->text; - - if (inst) // user passed instance ID - { - if (inst != ospf_instance) - return CMD_NOT_MY_INSTANCE; - } - - int type = 0; - int flag = 0; - int i; - - /* Check packet type. */ - if (strmatch(packet, "hello")) - type = OSPF_DEBUG_HELLO; - else if (strmatch(packet, "dd")) - type = OSPF_DEBUG_DB_DESC; - else if (strmatch(packet, "ls-request")) - type = OSPF_DEBUG_LS_REQ; - else if (strmatch(packet, "ls-update")) - type = OSPF_DEBUG_LS_UPD; - else if (strmatch(packet, "ls-ack")) - type = OSPF_DEBUG_LS_ACK; - else if (strmatch(packet, "all")) - type = OSPF_DEBUG_ALL; - - /* Cases: - * (none) = send + recv - * detail = send + recv + detail - * recv = recv - * send = send - * recv detail = recv + detail - * send detail = send + detail - */ - if (!send && !recv) - send = recv = 1; - - flag |= (send) ? OSPF_DEBUG_SEND : 0; - flag |= (recv) ? OSPF_DEBUG_RECV : 0; - flag |= (detail) ? OSPF_DEBUG_DETAIL : 0; - - for (i = 0; i < 5; i++) - if (type & (0x01 << i)) { - if (vty->node == CONFIG_NODE) - DEBUG_PACKET_ON(i, flag); - else - TERM_DEBUG_PACKET_ON(i, flag); - } - - return CMD_SUCCESS; -} - -DEFUN (no_debug_ospf_packet, - no_debug_ospf_packet_cmd, - "no debug ospf [(1-65535)] packet <hello|dd|ls-request|ls-update|ls-ack|all> [<send [detail]|recv [detail]|detail>]", + "[no$no] debug ospf [(1-65535)$inst] packet <hello|dd|ls-request|ls-update|ls-ack|all>$packet [<send$send [detail$detail]|recv$recv [detail$detail]|detail$detail>]", NO_STR DEBUG_STR OSPF_STR @@ -723,22 +648,13 @@ DEFUN (no_debug_ospf_packet, "Detail Information\n" "Detail Information\n") { - int inst = (argv[3]->type == RANGE_TKN) ? 1 : 0; - int detail = strmatch(argv[argc - 1]->text, "detail"); - int send = strmatch(argv[argc - (1 + detail)]->text, "send"); - int recv = strmatch(argv[argc - (1 + detail)]->text, "recv"); - char *packet = argv[4 + inst]->text; - - if (inst) // user passed instance ID - { - if (inst != ospf_instance) - return CMD_NOT_MY_INSTANCE; - } - int type = 0; int flag = 0; int i; + if (inst && inst != ospf_instance) + return CMD_NOT_MY_INSTANCE; + /* Check packet type. */ if (strmatch(packet, "hello")) type = OSPF_DEBUG_HELLO; @@ -761,8 +677,10 @@ DEFUN (no_debug_ospf_packet, * recv detail = recv + detail * send detail = send + detail */ - if (!send && !recv) - send = recv = 1; + if (!send && !recv) { + flag |= OSPF_DEBUG_SEND; + flag |= OSPF_DEBUG_RECV; + } flag |= (send) ? OSPF_DEBUG_SEND : 0; flag |= (recv) ? OSPF_DEBUG_RECV : 0; @@ -770,10 +688,17 @@ DEFUN (no_debug_ospf_packet, for (i = 0; i < 5; i++) if (type & (0x01 << i)) { - if (vty->node == CONFIG_NODE) - DEBUG_PACKET_OFF(i, flag); - else - TERM_DEBUG_PACKET_OFF(i, flag); + if (vty->node == CONFIG_NODE) { + if (no) + DEBUG_PACKET_OFF(i, flag); + else + DEBUG_PACKET_ON(i, flag); + } else { + if (no) + TERM_DEBUG_PACKET_OFF(i, flag); + else + TERM_DEBUG_PACKET_ON(i, flag); + } } #ifdef DEBUG @@ -1457,194 +1382,221 @@ DEFUN (no_debug_ospf_instance_nssa, return CMD_SUCCESS; } -DEFUN (debug_ospf_te, +DEFPY (debug_ospf_te, debug_ospf_te_cmd, - "debug ospf te", - DEBUG_STR - OSPF_STR - "OSPF-TE information\n") -{ - if (vty->node == CONFIG_NODE) - CONF_DEBUG_ON(te, TE); - TERM_DEBUG_ON(te, TE); - return CMD_SUCCESS; -} - -DEFUN (no_debug_ospf_te, - no_debug_ospf_te_cmd, - "no debug ospf te", + "[no$no] debug ospf [(1-65535)$instance] te", NO_STR DEBUG_STR OSPF_STR + "Instance ID\n" "OSPF-TE information\n") { - if (vty->node == CONFIG_NODE) - CONF_DEBUG_OFF(te, TE); - TERM_DEBUG_OFF(te, TE); + if (instance && instance != ospf_instance) + return CMD_NOT_MY_INSTANCE; + + if (vty->node == CONFIG_NODE) { + if (no) + DEBUG_OFF(te, TE); + else + DEBUG_ON(te, TE); + } else { + if (no) + TERM_DEBUG_OFF(te, TE); + else + TERM_DEBUG_ON(te, TE); + } + return CMD_SUCCESS; } -DEFUN (debug_ospf_sr, +DEFPY (debug_ospf_sr, debug_ospf_sr_cmd, - "debug ospf sr", + "[no$no] debug ospf [(1-65535)$instance] sr", + NO_STR DEBUG_STR OSPF_STR + "Instance ID\n" "OSPF-SR information\n") { - if (vty->node == CONFIG_NODE) - CONF_DEBUG_ON(sr, SR); - TERM_DEBUG_ON(sr, SR); + if (instance && instance != ospf_instance) + return CMD_NOT_MY_INSTANCE; + + if (vty->node == CONFIG_NODE) { + if (no) + DEBUG_OFF(sr, SR); + else + DEBUG_ON(sr, SR); + } else { + if (no) + TERM_DEBUG_OFF(sr, SR); + else + TERM_DEBUG_ON(sr, SR); + } + return CMD_SUCCESS; } -DEFUN (no_debug_ospf_sr, - no_debug_ospf_sr_cmd, - "no debug ospf sr", +DEFPY (debug_ospf_ti_lfa, + debug_ospf_ti_lfa_cmd, + "[no$no] debug ospf [(1-65535)$instance] ti-lfa", NO_STR DEBUG_STR OSPF_STR - "OSPF-SR information\n") + "Instance ID\n" + "OSPF-SR TI-LFA information\n") { - if (vty->node == CONFIG_NODE) - CONF_DEBUG_OFF(sr, SR); - TERM_DEBUG_OFF(sr, SR); - return CMD_SUCCESS; -} + if (instance && instance != ospf_instance) + return CMD_NOT_MY_INSTANCE; -DEFUN(debug_ospf_ti_lfa, debug_ospf_ti_lfa_cmd, "debug ospf ti-lfa", - DEBUG_STR OSPF_STR "OSPF-SR TI-LFA information\n") -{ - if (vty->node == CONFIG_NODE) - CONF_DEBUG_ON(ti_lfa, TI_LFA); - TERM_DEBUG_ON(ti_lfa, TI_LFA); - return CMD_SUCCESS; -} + if (vty->node == CONFIG_NODE) { + if (no) + DEBUG_OFF(ti_lfa, TI_LFA); + else + DEBUG_ON(ti_lfa, TI_LFA); + } else { + if (no) + TERM_DEBUG_OFF(ti_lfa, TI_LFA); + else + TERM_DEBUG_ON(ti_lfa, TI_LFA); + } -DEFUN(no_debug_ospf_ti_lfa, no_debug_ospf_ti_lfa_cmd, "no debug ospf ti-lfa", - NO_STR DEBUG_STR OSPF_STR "OSPF-SR TI-LFA information\n") -{ - if (vty->node == CONFIG_NODE) - CONF_DEBUG_OFF(ti_lfa, TI_LFA); - TERM_DEBUG_OFF(ti_lfa, TI_LFA); return CMD_SUCCESS; } -DEFUN (debug_ospf_default_info, +DEFPY (debug_ospf_default_info, debug_ospf_default_info_cmd, - "debug ospf default-information", + "[no$no] debug ospf [(1-65535)$instance] default-information", + NO_STR DEBUG_STR OSPF_STR + "Instance ID\n" "OSPF default information\n") { - if (vty->node == CONFIG_NODE) - CONF_DEBUG_ON(defaultinfo, DEFAULTINFO); - TERM_DEBUG_ON(defaultinfo, DEFAULTINFO); + if (instance && instance != ospf_instance) + return CMD_NOT_MY_INSTANCE; + + if (vty->node == CONFIG_NODE) { + if (no) + DEBUG_OFF(defaultinfo, DEFAULTINFO); + else + DEBUG_ON(defaultinfo, DEFAULTINFO); + } else { + if (no) + TERM_DEBUG_OFF(defaultinfo, DEFAULTINFO); + else + TERM_DEBUG_ON(defaultinfo, DEFAULTINFO); + } + return CMD_SUCCESS; } -DEFUN (no_debug_ospf_default_info, - no_debug_ospf_default_info_cmd, - "no debug ospf default-information", +DEFPY (debug_ospf_ldp_sync, + debug_ospf_ldp_sync_cmd, + "[no$no] debug ospf [(1-65535)$instance] ldp-sync", NO_STR DEBUG_STR OSPF_STR - "OSPF default information\n") -{ - if (vty->node == CONFIG_NODE) - CONF_DEBUG_OFF(defaultinfo, DEFAULTINFO); - TERM_DEBUG_OFF(defaultinfo, DEFAULTINFO); - return CMD_SUCCESS; -} - -DEFUN(debug_ospf_ldp_sync, - debug_ospf_ldp_sync_cmd, - "debug ospf ldp-sync", - DEBUG_STR OSPF_STR - "OSPF LDP-Sync information\n") + "Instance ID\n" + "OSPF LDP-Sync information\n") { - if (vty->node == CONFIG_NODE) - CONF_DEBUG_ON(ldp_sync, LDP_SYNC); - TERM_DEBUG_ON(ldp_sync, LDP_SYNC); - return CMD_SUCCESS; -} + if (instance && instance != ospf_instance) + return CMD_NOT_MY_INSTANCE; -DEFUN(no_debug_ospf_ldp_sync, - no_debug_ospf_ldp_sync_cmd, - "no debug ospf ldp-sync", - NO_STR - DEBUG_STR - OSPF_STR - "OSPF LDP-Sync information\n") -{ - if (vty->node == CONFIG_NODE) - CONF_DEBUG_OFF(ldp_sync, LDP_SYNC); - TERM_DEBUG_OFF(ldp_sync, LDP_SYNC); + if (vty->node == CONFIG_NODE) { + if (no) + DEBUG_OFF(ldp_sync, LDP_SYNC); + else + DEBUG_ON(ldp_sync, LDP_SYNC); + } else { + if (no) + TERM_DEBUG_OFF(ldp_sync, LDP_SYNC); + else + TERM_DEBUG_ON(ldp_sync, LDP_SYNC); + } return CMD_SUCCESS; } -DEFPY(debug_ospf_gr, debug_ospf_gr_cmd, "[no$no] debug ospf graceful-restart", - NO_STR DEBUG_STR OSPF_STR "OSPF Graceful Restart\n") +DEFPY (debug_ospf_gr, + debug_ospf_gr_cmd, + "[no$no] debug ospf [(1-65535)$instance] graceful-restart", + NO_STR + DEBUG_STR + OSPF_STR + "Instance ID\n" + "OSPF Graceful Restart\n") { - if (vty->node == CONFIG_NODE) - CONF_DEBUG_ON(gr, GR); + if (instance && instance != ospf_instance) + return CMD_NOT_MY_INSTANCE; - if (!no) - TERM_DEBUG_ON(gr, GR); - else + if (vty->node == CONFIG_NODE) { + if (no) + CONF_DEBUG_OFF(gr, GR); + else + CONF_DEBUG_ON(gr, GR); + } + + if (no) TERM_DEBUG_OFF(gr, GR); + else + TERM_DEBUG_ON(gr, GR); return CMD_SUCCESS; } -DEFPY(debug_ospf_bfd, debug_ospf_bfd_cmd, - "[no] debug ospf bfd", - NO_STR - DEBUG_STR - OSPF_STR - "Bidirection Forwarding Detection\n") +DEFPY (debug_ospf_bfd, + debug_ospf_bfd_cmd, + "[no] debug ospf [(1-65535)$instance] bfd", + NO_STR + DEBUG_STR + OSPF_STR + "Instance ID\n" + "Bidirection Forwarding Detection\n") { + if (instance && instance != ospf_instance) + return CMD_NOT_MY_INSTANCE; + if (vty->node == CONFIG_NODE) { if (no) { bfd_protocol_integration_set_debug(false); - CONF_DEBUG_OFF(bfd, BFD_LIB); + DEBUG_OFF(bfd, BFD_LIB); } else { bfd_protocol_integration_set_debug(true); - CONF_DEBUG_ON(bfd, BFD_LIB); + DEBUG_ON(bfd, BFD_LIB); } + } else { + if (no) + TERM_DEBUG_OFF(bfd, BFD_LIB); + else + TERM_DEBUG_ON(bfd, BFD_LIB); } - if (no) - TERM_DEBUG_OFF(bfd, BFD_LIB); - else - TERM_DEBUG_ON(bfd, BFD_LIB); - return CMD_SUCCESS; } -DEFUN(debug_ospf_client_api, - debug_ospf_client_api_cmd, - "debug ospf client-api", - DEBUG_STR OSPF_STR - "OSPF client API information\n") +DEFPY (debug_ospf_client_api, + debug_ospf_client_api_cmd, + "[no$no] debug ospf [(1-65535)$instance] client-api", + NO_STR + DEBUG_STR + OSPF_STR + "Instance ID\n" + "OSPF client API information\n") { - if (vty->node == CONFIG_NODE) - CONF_DEBUG_ON(client_api, CLIENT_API); - TERM_DEBUG_ON(client_api, CLIENT_API); - return CMD_SUCCESS; -} + if (instance && instance != ospf_instance) + return CMD_NOT_MY_INSTANCE; -DEFUN(no_debug_ospf_client_api, - no_debug_ospf_client_api_cmd, - "no debug ospf client-api", - NO_STR - DEBUG_STR - OSPF_STR - "OSPF client API information\n") -{ - if (vty->node == CONFIG_NODE) - CONF_DEBUG_OFF(client_api, CLIENT_API); - TERM_DEBUG_OFF(client_api, CLIENT_API); + if (vty->node == CONFIG_NODE) { + if (no) + DEBUG_OFF(client_api, CLIENT_API); + else + DEBUG_ON(client_api, CLIENT_API); + } else { + if (no) + TERM_DEBUG_OFF(client_api, CLIENT_API); + else + TERM_DEBUG_ON(client_api, CLIENT_API); + } return CMD_SUCCESS; } @@ -1816,7 +1768,7 @@ static int show_debugging_ospf_common(struct vty *vty) } if (IS_DEBUG_OSPF(defaultinfo, DEFAULTINFO) == OSPF_DEBUG_DEFAULTINFO) - vty_out(vty, "OSPF default information is on\n"); + vty_out(vty, " OSPF default information is on\n"); /* Show debug status for NSSA. */ if (IS_DEBUG_OSPF(nssa, NSSA) == OSPF_DEBUG_NSSA) @@ -1978,7 +1930,7 @@ static int config_write_debug(struct vty *vty) & (OSPF_DEBUG_SEND_RECV | OSPF_DEBUG_DETAIL); if (r == (OSPF_DEBUG_SEND_RECV | OSPF_DEBUG_DETAIL)) { vty_out(vty, "debug ospf%s packet all detail\n", str); - return 1; + write = 1; } /* debug ospf packet all. */ @@ -1991,7 +1943,7 @@ static int config_write_debug(struct vty *vty) if (conf_debug_ospf_packet[i] & OSPF_DEBUG_DETAIL) vty_out(vty, "debug ospf%s packet %s detail\n", str, type_str[i]); - return 1; + write = 1; } /* debug ospf packet (hello|dd|ls-request|ls-update|ls-ack) @@ -2047,6 +1999,13 @@ static int config_write_debug(struct vty *vty) write = 1; } + /* debug ospf default-information */ + if (IS_CONF_DEBUG_OSPF(defaultinfo, DEFAULTINFO) == + OSPF_DEBUG_DEFAULTINFO) { + vty_out(vty, "debug ospf%s default-information\n", str); + write = 1; + } + return write; } @@ -2074,18 +2033,11 @@ void ospf_debug_init(void) install_element(ENABLE_NODE, &no_debug_ospf_zebra_cmd); install_element(ENABLE_NODE, &no_debug_ospf_event_cmd); install_element(ENABLE_NODE, &no_debug_ospf_nssa_cmd); - install_element(ENABLE_NODE, &no_debug_ospf_te_cmd); - install_element(ENABLE_NODE, &no_debug_ospf_sr_cmd); - install_element(ENABLE_NODE, &no_debug_ospf_ti_lfa_cmd); - install_element(ENABLE_NODE, &no_debug_ospf_default_info_cmd); - install_element(ENABLE_NODE, &no_debug_ospf_ldp_sync_cmd); - install_element(ENABLE_NODE, &no_debug_ospf_client_api_cmd); install_element(ENABLE_NODE, &debug_ospf_gr_cmd); install_element(ENABLE_NODE, &debug_ospf_bfd_cmd); install_element(ENABLE_NODE, &show_debugging_ospf_instance_cmd); install_element(ENABLE_NODE, &debug_ospf_packet_cmd); - install_element(ENABLE_NODE, &no_debug_ospf_packet_cmd); install_element(ENABLE_NODE, &debug_ospf_instance_nsm_cmd); install_element(ENABLE_NODE, &debug_ospf_instance_lsa_cmd); @@ -2100,7 +2052,6 @@ void ospf_debug_init(void) install_element(ENABLE_NODE, &no_debug_ospf_cmd); install_element(CONFIG_NODE, &debug_ospf_packet_cmd); - install_element(CONFIG_NODE, &no_debug_ospf_packet_cmd); install_element(CONFIG_NODE, &debug_ospf_ism_cmd); install_element(CONFIG_NODE, &no_debug_ospf_ism_cmd); @@ -2120,12 +2071,6 @@ void ospf_debug_init(void) install_element(CONFIG_NODE, &no_debug_ospf_zebra_cmd); install_element(CONFIG_NODE, &no_debug_ospf_event_cmd); install_element(CONFIG_NODE, &no_debug_ospf_nssa_cmd); - install_element(CONFIG_NODE, &no_debug_ospf_te_cmd); - install_element(CONFIG_NODE, &no_debug_ospf_sr_cmd); - install_element(CONFIG_NODE, &no_debug_ospf_ti_lfa_cmd); - install_element(CONFIG_NODE, &no_debug_ospf_default_info_cmd); - install_element(CONFIG_NODE, &no_debug_ospf_ldp_sync_cmd); - install_element(CONFIG_NODE, &no_debug_ospf_client_api_cmd); install_element(CONFIG_NODE, &debug_ospf_gr_cmd); install_element(CONFIG_NODE, &debug_ospf_bfd_cmd); diff --git a/tests/topotests/bgp_gr_restart_retain_routes/r2/zebra.conf b/tests/topotests/bgp_gr_restart_retain_routes/r2/zebra.conf index c03dd7e197..758d797ad6 100644 --- a/tests/topotests/bgp_gr_restart_retain_routes/r2/zebra.conf +++ b/tests/topotests/bgp_gr_restart_retain_routes/r2/zebra.conf @@ -1,3 +1,4 @@ +no zebra nexthop kernel enable ! interface r2-eth0 ip address 192.168.255.2/24 |
