diff options
author | GalaxyGorilla <sascha@netdef.org> | 2020-12-07 13:13:26 +0100 |
---|---|---|
committer | Renato Westphal <renato@opensourcerouting.org> | 2021-07-05 16:43:02 +0200 |
commit | 3f87e1d8b398fdcfb34e51bc0cfd0dc7a4dd0cb4 (patch) | |
tree | b1c0cfed69f0fccb635b046b3ecc1d42560838d7 /ospfd | |
parent | ospfd: print extra LSA information in some log messages (diff) | |
download | frr-3f87e1d8b398fdcfb34e51bc0cfd0dc7a4dd0cb4.tar.xz frr-3f87e1d8b398fdcfb34e51bc0cfd0dc7a4dd0cb4.zip |
ospfd: adjust log config for GR
Remove previous log config
debug ospf graceful-restart helper
and just use
debug ospf graceful-restart
for everything related to OSPF GR.
Signed-off-by: GalaxyGorilla <sascha@netdef.org>
Diffstat (limited to 'ospfd')
-rw-r--r-- | ospfd/ospf_dump.c | 27 | ||||
-rw-r--r-- | ospfd/ospf_dump.h | 5 | ||||
-rw-r--r-- | ospfd/ospf_flood.c | 8 | ||||
-rw-r--r-- | ospfd/ospf_gr_helper.c | 51 | ||||
-rw-r--r-- | ospfd/ospf_nsm.c | 2 | ||||
-rw-r--r-- | ospfd/ospf_packet.c | 2 |
6 files changed, 44 insertions, 51 deletions
diff --git a/ospfd/ospf_dump.c b/ospfd/ospf_dump.c index e490070d0..f11c84b09 100644 --- a/ospfd/ospf_dump.c +++ b/ospfd/ospf_dump.c @@ -1552,21 +1552,16 @@ DEFUN(no_debug_ospf_ldp_sync, return CMD_SUCCESS; } -DEFPY (debug_ospf_gr, - debug_ospf_gr_cmd, - "[no$no] debug ospf graceful-restart helper", - NO_STR - DEBUG_STR OSPF_STR - "Gracefull restart\n" - "Helper Information\n") +DEFPY(debug_ospf_gr, debug_ospf_gr_cmd, "[no$no] debug ospf graceful-restart", + NO_STR DEBUG_STR OSPF_STR "OSPF Graceful Restart\n") { if (vty->node == CONFIG_NODE) - CONF_DEBUG_ON(gr, GR_HELPER); + CONF_DEBUG_ON(gr, GR); if (!no) - TERM_DEBUG_ON(gr, GR_HELPER); + TERM_DEBUG_ON(gr, GR); else - TERM_DEBUG_OFF(gr, GR_HELPER); + TERM_DEBUG_OFF(gr, GR); return CMD_SUCCESS; } @@ -1764,9 +1759,9 @@ static int show_debugging_ospf_common(struct vty *vty) if (IS_DEBUG_OSPF(ldp_sync, LDP_SYNC) == OSPF_DEBUG_LDP_SYNC) vty_out(vty, " OSPF ldp-sync debugging is on\n"); - /* Show debug status for GR helper. */ - if (IS_DEBUG_OSPF(gr, GR_HELPER) == OSPF_DEBUG_GR_HELPER) - vty_out(vty, " OSPF Graceful Restart Helper debugging is on\n"); + /* Show debug status for GR. */ + if (IS_DEBUG_OSPF(gr, GR) == OSPF_DEBUG_GR) + vty_out(vty, " OSPF Graceful Restart debugging is on\n"); if (IS_DEBUG_OSPF(bfd, BFD_LIB) == OSPF_DEBUG_BFD_LIB) vty_out(vty, @@ -1953,9 +1948,9 @@ static int config_write_debug(struct vty *vty) write = 1; } - /* debug ospf gr helper */ - if (IS_CONF_DEBUG_OSPF(gr, GR_HELPER) == OSPF_DEBUG_GR_HELPER) { - vty_out(vty, "debug ospf%s graceful-restart helper\n", str); + /* debug ospf gr */ + if (IS_CONF_DEBUG_OSPF(gr, GR) == OSPF_DEBUG_GR) { + vty_out(vty, "debug ospf%s graceful-restart\n", str); write = 1; } diff --git a/ospfd/ospf_dump.h b/ospfd/ospf_dump.h index b1c1d02a5..a1f55dd0a 100644 --- a/ospfd/ospf_dump.h +++ b/ospfd/ospf_dump.h @@ -64,8 +64,7 @@ #define OSPF_DEBUG_DEFAULTINFO 0x20 #define OSPF_DEBUG_LDP_SYNC 0x40 -#define OSPF_DEBUG_GR_HELPER 0x01 -#define OSPF_DEBUG_GR 0x03 +#define OSPF_DEBUG_GR 0x01 #define OSPF_DEBUG_BFD_LIB 0x01 @@ -118,7 +117,7 @@ #define IS_DEBUG_OSPF_DEFAULT_INFO IS_DEBUG_OSPF(defaultinfo, DEFAULTINFO) #define IS_DEBUG_OSPF_LDP_SYNC IS_DEBUG_OSPF(ldp_sync, LDP_SYNC) -#define IS_DEBUG_OSPF_GR_HELPER IS_DEBUG_OSPF(gr, GR_HELPER) +#define IS_DEBUG_OSPF_GR IS_DEBUG_OSPF(gr, GR) #define IS_CONF_DEBUG_OSPF_PACKET(a, b) \ (conf_debug_ospf_packet[a] & OSPF_DEBUG_##b) diff --git a/ospfd/ospf_flood.c b/ospfd/ospf_flood.c index cfdf892d9..a52812b86 100644 --- a/ospfd/ospf_flood.c +++ b/ospfd/ospf_flood.c @@ -385,7 +385,7 @@ int ospf_flood(struct ospf *ospf, struct ospf_neighbor *nbr, if (IS_LSA_MAXAGE(new)) { /* Handling Max age grace LSA.*/ - if (IS_DEBUG_OSPF_GR_HELPER) + if (IS_DEBUG_OSPF_GR) zlog_debug( "%s, Received a maxage GRACE-LSA from router %pI4", __func__, &new->data->adv_router); @@ -393,21 +393,21 @@ int ospf_flood(struct ospf *ospf, struct ospf_neighbor *nbr, if (current) { ospf_process_maxage_grace_lsa(ospf, new, nbr); } else { - if (IS_DEBUG_OSPF_GR_HELPER) + if (IS_DEBUG_OSPF_GR) zlog_debug( "%s, Grace LSA doesn't exist in lsdb, so discarding grace lsa", __func__); return -1; } } else { - if (IS_DEBUG_OSPF_GR_HELPER) + if (IS_DEBUG_OSPF_GR) zlog_debug( "%s, Received a GRACE-LSA from router %pI4", __func__, &new->data->adv_router); if (ospf_process_grace_lsa(ospf, new, nbr) == OSPF_GR_NOT_HELPER) { - if (IS_DEBUG_OSPF_GR_HELPER) + if (IS_DEBUG_OSPF_GR) zlog_debug( "%s, Not moving to HELPER role, So discarding grace LSA", __func__); diff --git a/ospfd/ospf_gr_helper.c b/ospfd/ospf_gr_helper.c index 520702b34..1465ed139 100644 --- a/ospfd/ospf_gr_helper.c +++ b/ospfd/ospf_gr_helper.c @@ -161,7 +161,7 @@ const char *ospf_rejected_reason2str(unsigned int reason) */ void ospf_gr_helper_instance_init(struct ospf *ospf) { - if (IS_DEBUG_OSPF_GR_HELPER) + if (IS_DEBUG_OSPF_GR) zlog_debug("%s, GR Helper init.", __func__); ospf->is_helper_supported = OSPF_GR_FALSE; @@ -187,7 +187,7 @@ void ospf_gr_helper_instance_init(struct ospf *ospf) */ void ospf_gr_helper_instance_stop(struct ospf *ospf) { - if (IS_DEBUG_OSPF_GR_HELPER) + if (IS_DEBUG_OSPF_GR) zlog_debug("%s, GR helper deinit.", __func__); ospf_enable_rtr_hash_destroy(ospf); @@ -203,7 +203,7 @@ void ospf_gr_helper_init(void) { int rc; - if (IS_DEBUG_OSPF_GR_HELPER) + if (IS_DEBUG_OSPF_GR) zlog_debug("%s, GR Helper init.", __func__); rc = ospf_register_opaque_functab( @@ -225,8 +225,7 @@ void ospf_gr_helper_init(void) */ void ospf_gr_helper_stop(void) { - - if (IS_DEBUG_OSPF_GR_HELPER) + if (IS_DEBUG_OSPF_GR) zlog_debug("%s, GR helper deinit.", __func__); ospf_delete_opaque_functab(OSPF_OPAQUE_LINK_LSA, OPAQUE_TYPE_GRACE_LSA); @@ -259,7 +258,7 @@ static int ospf_extract_grace_lsa_fields(struct ospf_lsa *lsa, /* Check LSA len */ if (lsa->size <= OSPF_LSA_HEADER_SIZE) { - if (IS_DEBUG_OSPF_GR_HELPER) + if (IS_DEBUG_OSPF_GR) zlog_debug("%s: Malformed packet: Invalid LSA len:%d", __func__, length); return OSPF_GR_FAILURE; @@ -272,7 +271,7 @@ static int ospf_extract_grace_lsa_fields(struct ospf_lsa *lsa, /* Check TLV len against overall LSA */ if (sum + TLV_SIZE(tlvh) > length) { - if (IS_DEBUG_OSPF_GR_HELPER) + if (IS_DEBUG_OSPF_GR) zlog_debug("%s: Malformed packet: Invalid TLV len:%u", __func__, TLV_SIZE(tlvh)); return OSPF_GR_FAILURE; @@ -324,7 +323,7 @@ static int ospf_extract_grace_lsa_fields(struct ospf_lsa *lsa, sum += TLV_SIZE(tlvh); break; default: - if (IS_DEBUG_OSPF_GR_HELPER) + if (IS_DEBUG_OSPF_GR) zlog_debug( "%s, Malformed packet.Invalid TLV type:%d", __func__, ntohs(tlvh->type)); @@ -391,12 +390,12 @@ int ospf_process_grace_lsa(struct ospf *ospf, struct ospf_lsa *lsa, ret = ospf_extract_grace_lsa_fields(lsa, &grace_interval, &restart_addr, &restart_reason); if (ret != OSPF_GR_SUCCESS) { - if (IS_DEBUG_OSPF_GR_HELPER) + if (IS_DEBUG_OSPF_GR) zlog_debug("%s, Wrong Grace LSA packet.", __func__); return OSPF_GR_NOT_HELPER; } - if (IS_DEBUG_OSPF_GR_HELPER) + if (IS_DEBUG_OSPF_GR) zlog_debug( "%s, Grace LSA received from %pI4, grace interval:%u, restart reason:%s", __func__, &restart_addr, grace_interval, @@ -410,7 +409,7 @@ int ospf_process_grace_lsa(struct ospf *ospf, struct ospf_lsa *lsa, restarter = ospf_nbr_lookup_by_addr(oi->nbrs, &restart_addr); if (!restarter) { - if (IS_DEBUG_OSPF_GR_HELPER) + if (IS_DEBUG_OSPF_GR) zlog_debug( "%s, Restarter is not a nbr(%pI4) for this router.", __func__, &restart_addr); @@ -427,7 +426,7 @@ int ospf_process_grace_lsa(struct ospf *ospf, struct ospf_lsa *lsa, lookup.advRtrAddr.s_addr = restarter->router_id.s_addr; if (!hash_lookup(ospf->enable_rtr_list, &lookup)) { - if (IS_DEBUG_OSPF_GR_HELPER) + if (IS_DEBUG_OSPF_GR) zlog_debug( "%s, HELPER support is disabled, So not a HELPER", __func__); @@ -442,7 +441,7 @@ int ospf_process_grace_lsa(struct ospf *ospf, struct ospf_lsa *lsa, * became a adjacency. */ if (!IS_NBR_STATE_FULL(restarter)) { - if (IS_DEBUG_OSPF_GR_HELPER) + if (IS_DEBUG_OSPF_GR) zlog_debug( "%s, This Neighbour %pI4 is not in FULL state.", __func__, &restarter->src); @@ -456,7 +455,7 @@ int ospf_process_grace_lsa(struct ospf *ospf, struct ospf_lsa *lsa, */ if (ospf->only_planned_restart && !OSPF_GR_IS_PLANNED_RESTART(restart_reason)) { - if (IS_DEBUG_OSPF_GR_HELPER) + if (IS_DEBUG_OSPF_GR) zlog_debug( "%s, Router supports only planned restarts but received the GRACE LSA for an unplanned restart.", __func__); @@ -470,7 +469,7 @@ int ospf_process_grace_lsa(struct ospf *ospf, struct ospf_lsa *lsa, */ if (ospf->strict_lsa_check && !ospf_ls_retransmit_isempty(restarter) && ospf_check_change_in_rxmt_list(restarter)) { - if (IS_DEBUG_OSPF_GR_HELPER) + if (IS_DEBUG_OSPF_GR) zlog_debug( "%s, Changed LSA in Rxmt list. So not Helper.", __func__); @@ -481,7 +480,7 @@ int ospf_process_grace_lsa(struct ospf *ospf, struct ospf_lsa *lsa, /*LSA age must be less than the grace period */ if (ntohs(lsa->data->ls_age) >= grace_interval) { - if (IS_DEBUG_OSPF_GR_HELPER) + if (IS_DEBUG_OSPF_GR) zlog_debug( "%s, Grace LSA age(%d) is more than the grace interval(%d)", __func__, lsa->data->ls_age, grace_interval); @@ -497,7 +496,7 @@ int ospf_process_grace_lsa(struct ospf *ospf, struct ospf_lsa *lsa, */ actual_grace_interval = grace_interval; if (grace_interval > ospf->supported_grace_time) { - if (IS_DEBUG_OSPF_GR_HELPER) + if (IS_DEBUG_OSPF_GR) zlog_debug( "%s, Received grace period %d is larger than supported grace %d", __func__, grace_interval, @@ -512,12 +511,12 @@ int ospf_process_grace_lsa(struct ospf *ospf, struct ospf_lsa *lsa, if (ospf->active_restarter_cnt > 0) ospf->active_restarter_cnt--; - if (IS_DEBUG_OSPF_GR_HELPER) + if (IS_DEBUG_OSPF_GR) zlog_debug( "%s, Router is already acting as a HELPER for this nbr,so restart the grace timer", __func__); } else { - if (IS_DEBUG_OSPF_GR_HELPER) + if (IS_DEBUG_OSPF_GR) zlog_debug( "%s, This Router becomes a HELPER for the neighbour %pI4", __func__, &restarter->src); @@ -535,7 +534,7 @@ int ospf_process_grace_lsa(struct ospf *ospf, struct ospf_lsa *lsa, /* Increment the active restarter count */ ospf->active_restarter_cnt++; - if (IS_DEBUG_OSPF_GR_HELPER) + if (IS_DEBUG_OSPF_GR) zlog_debug("%s, Grace timer started.interval:%d", __func__, actual_grace_interval); @@ -622,7 +621,7 @@ void ospf_helper_handle_topo_chg(struct ospf *ospf, struct ospf_lsa *lsa) if (!ospf->strict_lsa_check) return; - if (IS_DEBUG_OSPF_GR_HELPER) + if (IS_DEBUG_OSPF_GR) zlog_debug("%s: Topo change detected due to LSA[%s]", __func__, dump_lsa_key(lsa)); @@ -685,7 +684,7 @@ void ospf_gr_helper_exit(struct ospf_neighbor *nbr, if (!OSPF_GR_IS_ACTIVE_HELPER(nbr)) return; - if (IS_DEBUG_OSPF_GR_HELPER) + if (IS_DEBUG_OSPF_GR) zlog_debug("%s, Exiting from HELPER support to %pI4, due to %s", __func__, &nbr->src, ospf_exit_reason2str(reason)); @@ -716,7 +715,7 @@ void ospf_gr_helper_exit(struct ospf_neighbor *nbr, * If no, bring down the neighbour. */ if (reason != OSPF_GR_HELPER_COMPLETED) { - if (IS_DEBUG_OSPF_GR_HELPER) + if (IS_DEBUG_OSPF_GR) zlog_debug( "%s, Failed GR exit, so bringing down the neighbour", __func__); @@ -767,12 +766,12 @@ void ospf_process_maxage_grace_lsa(struct ospf *ospf, struct ospf_lsa *lsa, ret = ospf_extract_grace_lsa_fields(lsa, &graceInterval, &restartAddr, &restartReason); if (ret != OSPF_GR_SUCCESS) { - if (IS_DEBUG_OSPF_GR_HELPER) + if (IS_DEBUG_OSPF_GR) zlog_debug("%s, Wrong Grace LSA packet.", __func__); return; } - if (IS_DEBUG_OSPF_GR_HELPER) + if (IS_DEBUG_OSPF_GR) zlog_debug("%s, GraceLSA received for neighbour %pI4", __func__, &restartAddr); @@ -784,7 +783,7 @@ void ospf_process_maxage_grace_lsa(struct ospf *ospf, struct ospf_lsa *lsa, restarter = ospf_nbr_lookup_by_addr(oi->nbrs, &restartAddr); if (!restarter) { - if (IS_DEBUG_OSPF_GR_HELPER) + if (IS_DEBUG_OSPF_GR) zlog_debug( "%s, Restarter is not a neighbour for this router.", __func__); diff --git a/ospfd/ospf_nsm.c b/ospfd/ospf_nsm.c index b3b9244b2..0dc150852 100644 --- a/ospfd/ospf_nsm.c +++ b/ospfd/ospf_nsm.c @@ -75,7 +75,7 @@ static int ospf_inactivity_timer(struct thread *thread) */ if (!OSPF_GR_IS_ACTIVE_HELPER(nbr)) OSPF_NSM_EVENT_SCHEDULE(nbr, NSM_InactivityTimer); - else if (IS_DEBUG_OSPF_GR_HELPER) + else if (IS_DEBUG_OSPF_GR) zlog_debug( "%s, Acting as HELPER for this neighbour, So inactivitytimer event will not be fired.", __func__); diff --git a/ospfd/ospf_packet.c b/ospfd/ospf_packet.c index d9b9f1d22..e3a8eabda 100644 --- a/ospfd/ospf_packet.c +++ b/ospfd/ospf_packet.c @@ -4263,7 +4263,7 @@ void ospf_ls_ack_send(struct ospf_neighbor *nbr, struct ospf_lsa *lsa) struct ospf_interface *oi = nbr->oi; if (IS_GRACE_LSA(lsa)) { - if (IS_DEBUG_OSPF_GR_HELPER) + if (IS_DEBUG_OSPF_GR) zlog_debug("%s, Sending GRACE ACK to Restarter.", __func__); } |