]> git.puffer.fish Git - mirror/frr.git/commitdiff
ospfd: adjust log config for GR
authorGalaxyGorilla <sascha@netdef.org>
Mon, 7 Dec 2020 12:13:26 +0000 (12:13 +0000)
committerRenato Westphal <renato@opensourcerouting.org>
Mon, 5 Jul 2021 14:43:02 +0000 (11:43 -0300)
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>
ospfd/ospf_dump.c
ospfd/ospf_dump.h
ospfd/ospf_flood.c
ospfd/ospf_gr_helper.c
ospfd/ospf_nsm.c
ospfd/ospf_packet.c

index e490070d036c5d5636f09f9e081e352b05475b1a..f11c84b092f94cd7892af1812de25e66c3bcbf81 100644 (file)
@@ -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;
        }
 
index b1c1d02a5115472766c906e281a5af92932c2456..a1f55dd0af7c95e95bb5aea5112c88615aa9c172 100644 (file)
@@ -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
 
 #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)
index cfdf892d9a7559f88cc73898d0ade73ce0f213c4..a52812b8675300872d09ae6d7f24b13864974e96 100644 (file)
@@ -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__);
index 520702b3440ebfe14beb0752f5847a0f5dc1935d..1465ed139abc4836517cdcb9055197f6e2ed47de 100644 (file)
@@ -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__);
index b3b9244b22d543af76df5608cb9292991dfc5837..0dc1508528ce5eac449d70a1c3457a33bcde0b32 100644 (file)
@@ -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__);
index d9b9f1d22e7b0d592240ce5422f2f021c926b4b1..e3a8eabdaf9d5bdc3772ca714efd1b4023f7f494 100644 (file)
@@ -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__);
        }