]> git.puffer.fish Git - matthieu/frr.git/commitdiff
ospfd: print extra LSA information in some log messages
authorRenato Westphal <renato@opensourcerouting.org>
Mon, 31 May 2021 13:27:51 +0000 (10:27 -0300)
committerRenato Westphal <renato@opensourcerouting.org>
Mon, 5 Jul 2021 14:43:02 +0000 (11:43 -0300)
Log the LSA advertising router in addition to the LSA type and
ID in the places where that information is necessary to uniquely
identify the LSA in the LSDB.

This is useful, for example, to know exactly which LSA has changed
when the router is exiting from the GR helper mode when a topology
change was detected.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
ospfd/ospf_flood.c
ospfd/ospf_gr_helper.c
ospfd/ospf_lsa.c
ospfd/ospf_opaque.c
ospfd/ospf_packet.c

index 6c1ac6761af8f525bb9035015be23a2e37302251..cfdf892d9a7559f88cc73898d0ade73ce0f213c4 100644 (file)
@@ -1036,8 +1036,8 @@ void ospf_lsa_flush_area(struct ospf_lsa *lsa, struct ospf_area *area)
           retransmissions */
        lsa->data->ls_age = htons(OSPF_LSA_MAXAGE);
        if (IS_DEBUG_OSPF_EVENT)
-               zlog_debug("%s: MAXAGE set to LSA %pI4", __func__,
-                          &lsa->data->id);
+               zlog_debug("%s: MaxAge set to LSA[%s]", __func__,
+                          dump_lsa_key(lsa));
        monotime(&lsa->tv_recv);
        lsa->tv_orig = lsa->tv_recv;
        ospf_flood_through_area(area, NULL, lsa);
@@ -1050,6 +1050,9 @@ void ospf_lsa_flush_as(struct ospf *ospf, struct ospf_lsa *lsa)
           more time for the ACK to be received and avoid
           retransmissions */
        lsa->data->ls_age = htons(OSPF_LSA_MAXAGE);
+       if (IS_DEBUG_OSPF_EVENT)
+               zlog_debug("%s: MaxAge set to LSA[%s]", __func__,
+                          dump_lsa_key(lsa));
        monotime(&lsa->tv_recv);
        lsa->tv_orig = lsa->tv_recv;
        ospf_flood_through_as(ospf, NULL, lsa);
index b32318b832a568eaee533640b21ed54c6d3b31cf..520702b3440ebfe14beb0752f5847a0f5dc1935d 100644 (file)
@@ -623,9 +623,8 @@ void ospf_helper_handle_topo_chg(struct ospf *ospf, struct ospf_lsa *lsa)
                return;
 
        if (IS_DEBUG_OSPF_GR_HELPER)
-               zlog_debug(
-                       "%s, Topo change detected due to lsa LSID:%pI4 type:%d",
-                       __func__, &lsa->data->id, lsa->data->type);
+               zlog_debug("%s: Topo change detected due to LSA[%s]", __func__,
+                          dump_lsa_key(lsa));
 
        lsa->to_be_acknowledged = OSPF_GR_TRUE;
 
index c850df55bb5892a4799f601d5bd619810ed22a1b..b098581cec4c42e3434735dedeedd88cde906a7e 100644 (file)
@@ -2791,8 +2791,8 @@ struct ospf_lsa *ospf_lsa_install(struct ospf *ospf, struct ospf_interface *oi,
         */
        if (IS_LSA_MAXAGE(new)) {
                if (IS_DEBUG_OSPF(lsa, LSA_INSTALL))
-                       zlog_debug("LSA[Type%d:%pI4]: Install LSA %p, MaxAge",
-                                  new->data->type, &new->data->id, lsa);
+                       zlog_debug("LSA[%s]: Install LSA %p, MaxAge",
+                                  dump_lsa_key(new), lsa);
                ospf_lsa_maxage(ospf, lsa);
        }
 
@@ -2874,9 +2874,8 @@ static int ospf_maxage_lsa_remover(struct thread *thread)
 
                        if (IS_DEBUG_OSPF(lsa, LSA_FLOODING))
                                zlog_debug(
-                                       "LSA[Type%d:%pI4]: MaxAge LSA removed from list",
-                                       lsa->data->type,
-                                       &lsa->data->id);
+                                       "LSA[%s]: MaxAge LSA removed from list",
+                                       dump_lsa_key(lsa));
 
                        if (CHECK_FLAG(lsa->flags, OSPF_LSA_PREMATURE_AGE)) {
                                if (IS_DEBUG_OSPF(lsa, LSA_FLOODING))
@@ -2894,9 +2893,8 @@ static int ospf_maxage_lsa_remover(struct thread *thread)
                                 */
                                if (old != lsa) {
                                        flog_err(EC_OSPF_LSA_MISSING,
-                                                "%s: LSA[Type%d:%pI4]: LSA not in LSDB",
-                                                __func__, lsa->data->type,
-                                                &lsa->data->id);
+                                                "%s: LSA[%s]: LSA not in LSDB",
+                                                __func__, dump_lsa_key(lsa));
 
                                        continue;
                                }
@@ -2905,9 +2903,8 @@ static int ospf_maxage_lsa_remover(struct thread *thread)
                        } else {
                                if (IS_DEBUG_OSPF(lsa, LSA_FLOODING))
                                        zlog_debug(
-                                               "%s: LSA[Type%d:%pI4]: No associated LSDB!",
-                                               __func__, lsa->data->type,
-                                               &lsa->data->id);
+                                               "%s: LSA[%s]: No associated LSDB!",
+                                               __func__, dump_lsa_key(lsa));
                        }
                }
 
@@ -2964,9 +2961,8 @@ void ospf_lsa_maxage(struct ospf *ospf, struct ospf_lsa *lsa)
        if (CHECK_FLAG(lsa->flags, OSPF_LSA_IN_MAXAGE)) {
                if (IS_DEBUG_OSPF(lsa, LSA_FLOODING))
                        zlog_debug(
-                               "LSA[Type%d:%pI4]: %p already exists on MaxAge LSA list",
-                               lsa->data->type, &lsa->data->id,
-                               (void *)lsa);
+                               "LSA[%s]: %p already exists on MaxAge LSA list",
+                               dump_lsa_key(lsa), lsa);
                return;
        }
 
index fac2f97141b5b78fcad95021316ee74bdceec060..9ec2ed0aa8df42c306aea1cc8f712b14fd1f01ac 100644 (file)
@@ -2147,6 +2147,11 @@ void ospf_opaque_self_originated_lsa_received(struct ospf_neighbor *nbr,
        if ((top = oi_to_top(nbr->oi)) == NULL)
                return;
 
+       if (IS_DEBUG_OSPF_EVENT)
+               zlog_debug(
+                       "LSA[Type%d:%pI4]: processing self-originated Opaque-LSA",
+                       lsa->data->type, &lsa->data->id);
+
        /*
         * Since these LSA entries are not yet installed into corresponding
         * LSDB, just flush them without calling ospf_ls_maxage() afterward.
index 580eee13cf0815117d1934f5f9030c7caddf25fd..d9b9f1d22e7b0d592240ce5422f2f021c926b4b1 100644 (file)
@@ -3575,14 +3575,13 @@ static int ospf_make_ls_upd(struct ospf_interface *oi, struct list *update,
                struct lsa_header *lsah;
                uint16_t ls_age;
 
-               if (IS_DEBUG_OSPF_EVENT)
-                       zlog_debug("ospf_make_ls_upd: List Iteration %d",
-                                  count);
-
                lsa = listgetdata(node);
-
                assert(lsa->data);
 
+               if (IS_DEBUG_OSPF_EVENT)
+                       zlog_debug("%s: List Iteration %d LSA[%s]", __func__,
+                                  count, dump_lsa_key(lsa));
+
                /* Will it fit? Minimum it has to fit atleast one */
                if ((length + delta + ntohs(lsa->data->length) > size_noauth) &&
                                (count > 0))